From patchwork Mon Jun 29 07:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Gupta X-Patchwork-Id: 209246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B56DC433DF for ; Mon, 29 Jun 2020 20:54:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06C0B20724 for ; Mon, 29 Jun 2020 20:54:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M1hIH6mF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731599AbgF2Uyb (ORCPT ); Mon, 29 Jun 2020 16:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731274AbgF2TNS (ORCPT ); Mon, 29 Jun 2020 15:13:18 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19E8C0A8935; Mon, 29 Jun 2020 00:37:29 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id u8so7398778pje.4; Mon, 29 Jun 2020 00:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wNBasksRn6HqqFy9YNin3k0xj1oUFrdl5Lr5u3FSELQ=; b=M1hIH6mFmORSCGE86XorMiBP7P08Gf4iZf58OyrKtzhu/cv2OISPl0WAHowytkfrXb Dxtp9KEV+JThYTPWvaCa029Z+U7sItPFnlKrjYO+P7uwh/rTbA4R4HTUSv5AlaBsq51O k8PDB3rzBRmgXTeZ8DdA/U/csAwKlTqGKtV4Y4qJkujlyGSF63nQAmcrkA61IBbPlvXI leqBFDNv9s7LvFlq4dGOdA+uUpzsrcRl36VOzX57aTt6Smf7gdRwvxKPLW1qT9TnG3Ds WZuuLNR/i/9WGDTcE6PYFhdE5tX2xgAWxR53fnb1MLYIY9J+qFyGGcOgglFfMOV/dy2n aiOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wNBasksRn6HqqFy9YNin3k0xj1oUFrdl5Lr5u3FSELQ=; b=uLmZM2xmd8pI7EBLW6+W6OYYbW5pUqH8SuWUT6rwp8dn/Lb/XwIyJXqIcubYh0o0ve SPA7GwntPsPDTHG99myZnFH3XYhkwebeY0Jxx8mQprWpLYeDe3x7TfeEibB+9FGgiari Fcw/uu1NsqqF3jXN3enC5+SNA9DPhaTtTtJVoac2tjWOTWn9oGzv25ghrIj266yjUxwM t+fVKwieAnWUWLeVNrrNS9xtatpOZyPrKt5nN9ImIrJf1GPtUTg6t9S9P1j2+QhGIzg0 MOpgUdO33Z9y1JFm6lB+BLOfFCkgHjSvW5aP+/B9a8iOGtAdxvm9XO1dhW4cW1RPgg4k B1Jw== X-Gm-Message-State: AOAM5311QgMKiE28XauWmZ3uZw4mbsdJsK5c4JrIffcs7kUBIlyBDHv/ P8ZMe6dRRfsRoPhMHKTJmmk= X-Google-Smtp-Source: ABdhPJw5JV6v034J4F08OVzJgY5QNT872fYtNd1w2ulu2+H64M023gpnMHfQNOtSd3meU2msqry31Q== X-Received: by 2002:a17:902:54f:: with SMTP id 73mr12020846plf.76.1593416249351; Mon, 29 Jun 2020 00:37:29 -0700 (PDT) Received: from varodek.iballbatonwifi.com ([103.105.153.57]) by smtp.gmail.com with ESMTPSA id q10sm34673004pfk.86.2020.06.29.00.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 00:37:28 -0700 (PDT) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , bjorn@helgaas.com, Vaibhav Gupta , Mauro Carvalho Chehab Cc: Vaibhav Gupta , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org Subject: [PATCH v1 2/6] [media] cx23885: use generic power management Date: Mon, 29 Jun 2020 13:06:00 +0530 Message-Id: <20200629073604.205478-3-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629073604.205478-1-vaibhavgupta40@gmail.com> References: <20200629073604.205478-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .suspend() and .resume() callbacks are not defined for this driver. Still, their power managemgement stucture can be easily upgraded to gemeric, without affecting its normal behaviour. Hence, define them NULL and use struct dev_pm_ops type to bind them. Compile-tested only. Signed-off-by: Vaibhav Gupta --- drivers/media/pci/cx23885/cx23885-core.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index 7e0b0b7cc2a3..da9ee7270dfd 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -2230,14 +2230,18 @@ static const struct pci_device_id cx23885_pci_tbl[] = { }; MODULE_DEVICE_TABLE(pci, cx23885_pci_tbl); +#define cx23885_suspend NULL +#define cx23885_resume NULL + +static SIMPLE_DEV_PM_OPS(cx23885_pm_ops, cx23885_suspend, cx23885_resume); + static struct pci_driver cx23885_pci_driver = { - .name = "cx23885", - .id_table = cx23885_pci_tbl, - .probe = cx23885_initdev, - .remove = cx23885_finidev, + .name = "cx23885", + .id_table = cx23885_pci_tbl, + .probe = cx23885_initdev, + .remove = cx23885_finidev, /* TODO */ - .suspend = NULL, - .resume = NULL, + .driver.pm = &cx23885_pm_ops, }; static int __init cx23885_init(void) From patchwork Mon Jun 29 07:36:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Gupta X-Patchwork-Id: 209247 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4F1AC433E0 for ; Mon, 29 Jun 2020 20:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F48220663 for ; Mon, 29 Jun 2020 20:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZoWk5+P4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732760AbgF2Uqn (ORCPT ); Mon, 29 Jun 2020 16:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731543AbgF2TNw (ORCPT ); Mon, 29 Jun 2020 15:13:52 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666C2C0A8936; Mon, 29 Jun 2020 00:37:34 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id b184so1127823pfa.6; Mon, 29 Jun 2020 00:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M1eWlmJknPlaq4iBEb26E6JSPq8jyG2XC9mR0Df08JE=; b=ZoWk5+P4rjcM0P7NJzK7080uXsU6qIIS3avQ6XYyaJJKtaWZpbT29DeSJXZg5qoR7M 7CBFX08H84xXbjEGQVj6g57MZ8Cv8uyNbXonrVuHNLgqF46jAdpvi8ocxy8GjNWjC4C3 +3LmIIy6TrhWf7m4KllNP6crK/ELeX+2vuDlJ6p25HiG2GP1/1jN7IIqnxQNMeQJmdT4 rK6u/59MNeUV7ciVPBV5i83zSsn3/dv35xyVBBysuH/83LhOfG9qZjpZbpoAw28Gd9c4 dIvKeEOEaOcc3dE7y8kaqkdzAAFVsqgbX4fAUTWcXu5rX3K4YkPkqmFwx9x8iA+yXOD4 uvRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M1eWlmJknPlaq4iBEb26E6JSPq8jyG2XC9mR0Df08JE=; b=kmO/NnxZvTjBFJS+hKlLmmguUALrAi+OY9em7n5DFXRLhx4I9WqYBVZcBDCKBvp6ZA gslv3IqoUTmNmE0SW34OxtMW2CMOfTtRzlNWH5aRI/AiuLvqHCI5BvWLqZzMncgz8ist hQ5WJVli7uP+YVOLFpkeD4L0pl6XfY8J1EjXBYMXVycOTGIRu57r1rbK/c1tvOOWE13n pxeW/mwCh2Rebi29hSiXXOC3u1gL/dayy6NxUySsDcN9cr8GCW9qjJKfSVJ5mmSI11ct hfam/LC7T4/b8SJMha0H2s4u00o888Nk0CEcnUgXgWrz7fqCr63W+/RpMjQqK9UXfxu9 139Q== X-Gm-Message-State: AOAM5300lAfpI9/RXlK5gsITuF9WE+kIZ8/N3MZ/4z1WFVimfQ/KUmBs PPhLHi0HL79Qh/nex37PlLQ= X-Google-Smtp-Source: ABdhPJydYwb6IghBaB9/JJLG0sM0hcusmh3mXrqhfkRKFx43w7QdBeZoPsQYEN6Kw++x7HYyl1rBYw== X-Received: by 2002:a63:5c55:: with SMTP id n21mr8836754pgm.27.1593416253909; Mon, 29 Jun 2020 00:37:33 -0700 (PDT) Received: from varodek.iballbatonwifi.com ([103.105.153.57]) by smtp.gmail.com with ESMTPSA id q10sm34673004pfk.86.2020.06.29.00.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 00:37:33 -0700 (PDT) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , bjorn@helgaas.com, Vaibhav Gupta , Mauro Carvalho Chehab Cc: Vaibhav Gupta , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org Subject: [PATCH v1 3/6] [media] cx25821: use generic power management Date: Mon, 29 Jun 2020 13:06:01 +0530 Message-Id: <20200629073604.205478-4-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629073604.205478-1-vaibhavgupta40@gmail.com> References: <20200629073604.205478-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .suspend() and .resume() callbacks are not defined for this driver. Still, their power managemgement stucture can be easily upgraded to gemeric, without affecting its normal behaviour. Hence, define them NULL and use struct dev_pm_ops type to bind them. Compile-tested only. Signed-off-by: Vaibhav Gupta --- drivers/media/pci/cx25821/cx25821-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx25821/cx25821-core.c b/drivers/media/pci/cx25821/cx25821-core.c index 41be22ce66f3..59501939d741 100644 --- a/drivers/media/pci/cx25821/cx25821-core.c +++ b/drivers/media/pci/cx25821/cx25821-core.c @@ -1369,14 +1369,18 @@ static const struct pci_device_id cx25821_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, cx25821_pci_tbl); +#define cx25821_suspend NULL +#define cx25821_resume NULL + +static SIMPLE_DEV_PM_OPS(cx25821_pm_ops, cx25821_suspend, cx25821_resume); + static struct pci_driver cx25821_pci_driver = { .name = "cx25821", .id_table = cx25821_pci_tbl, .probe = cx25821_initdev, .remove = cx25821_finidev, /* TODO */ - .suspend = NULL, - .resume = NULL, + .driver.pm = &cx25821_pm_ops, }; static int __init cx25821_init(void) From patchwork Mon Jun 29 07:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Gupta X-Patchwork-Id: 209248 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E55AC433DF for ; Mon, 29 Jun 2020 20:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4568120663 for ; Mon, 29 Jun 2020 20:42:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MIatfl+V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389196AbgF2Umw (ORCPT ); Mon, 29 Jun 2020 16:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731643AbgF2TOD (ORCPT ); Mon, 29 Jun 2020 15:14:03 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A812BC0A8938; Mon, 29 Jun 2020 00:37:43 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id p3so7917922pgh.3; Mon, 29 Jun 2020 00:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oh8xk0TqxiDTOzgBpulOm8nQjP8syH1MFAg9SRwAtT4=; b=MIatfl+V/S3Ufh1oJKUjfSYjWTmUU/I4l8mB4A/EKjCUpWBHDGtAhP83RxBxd1bHvD lXMsMA8EOKV6umjuLT/2CYBWWzgQplUr4UznpJFcgv+pcDVuN6EZ5wQrxpKQjprComuT nHDJcRnQxbMqG/GFEl0rn6CeYVw/L+y13vvJcDDNTOzb6Q+4N39cwg8hZ6ZTcAngeVsF 1cSxq625BZofQfgcUsXpYgXMp/vbZR/x/TgmZ8l05avVmFY0MGKJbbZzoBuKQVOiN6Yx EGow6axDN5/am1TjjJUN8SySu0kCKAgSufBzhuUxItbrNZXquDIGAdoPAKJ3gB67pf4P cbtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Oh8xk0TqxiDTOzgBpulOm8nQjP8syH1MFAg9SRwAtT4=; b=r60NIcJdy2CbCvLraPAEUDAdUXEWydYkcf+/pUDMnfpvC9guf6X3H+/P/jidlXqKRK 1laeriKMitPebmJfkH5OwZnOHOtd7vFI5ViB8LQXfTN3VaQTHtjtfc7Kx4G1t0RT8tzf kLYRTa8L7qVWxQhabOYE6iKKi/TSZGI4srcSOtvEPzN6GcffHLIAaQIusSvaT7QMAnGk h0mNnHYKPhgmsmIZe8vLqGMYAcaoSaGPtZE3CjxkgXr9P+UjJF67/5cv+k0sUtI2ZE3A bYAnakZrokdI3bMVO5RNbkKGGY6IscCnr8/WfZbdtjWC5xzBJlwWnXpNdutPlVMQjxQv ND/A== X-Gm-Message-State: AOAM532N1+toYwjEvrQJ69YCBm6x9ca/opEohpSM2S4WL3Os6ui3kU0e CWw0dUfzhkabpl4sQKtKpC0= X-Google-Smtp-Source: ABdhPJxu4ilTfacJ81Zt5Q839MN4J+yYfSr9e3LiZl9nj6Qi2F2XwvNT/FoD5dFAEy+ie8AFvMhcRw== X-Received: by 2002:a62:54c4:: with SMTP id i187mr13504579pfb.263.1593416263218; Mon, 29 Jun 2020 00:37:43 -0700 (PDT) Received: from varodek.iballbatonwifi.com ([103.105.153.57]) by smtp.gmail.com with ESMTPSA id q10sm34673004pfk.86.2020.06.29.00.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 00:37:42 -0700 (PDT) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , bjorn@helgaas.com, Vaibhav Gupta , Mauro Carvalho Chehab Cc: Vaibhav Gupta , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org Subject: [PATCH v1 5/6] [media] meye: use generic power management Date: Mon, 29 Jun 2020 13:06:03 +0530 Message-Id: <20200629073604.205478-6-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629073604.205478-1-vaibhavgupta40@gmail.com> References: <20200629073604.205478-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. The driver was invoking PCI helper functions like pci_save/restore_state() which is not recommended. Compile-tested only. Signed-off-by: Vaibhav Gupta --- drivers/media/pci/meye/meye.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 73e064e6f56d..7fb3b1853b87 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c @@ -1528,19 +1528,16 @@ static const struct v4l2_ctrl_ops meye_ctrl_ops = { .s_ctrl = meye_s_ctrl, }; -#ifdef CONFIG_PM -static int meye_suspend(struct pci_dev *pdev, pm_message_t state) +static int __maybe_unused meye_suspend(struct device *dev) { - pci_save_state(pdev); meye.pm_mchip_mode = meye.mchip_mode; mchip_hic_stop(); mchip_set(MCHIP_MM_INTA, 0x0); return 0; } -static int meye_resume(struct pci_dev *pdev) +static int __maybe_unused meye_resume(struct device *dev) { - pci_restore_state(pdev); pci_write_config_word(meye.mchip_dev, MCHIP_PCI_SOFTRESET_SET, 1); mchip_delay(MCHIP_HIC_CMD, 0); @@ -1562,7 +1559,6 @@ static int meye_resume(struct pci_dev *pdev) } return 0; } -#endif static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) { @@ -1788,15 +1784,14 @@ static const struct pci_device_id meye_pci_tbl[] = { MODULE_DEVICE_TABLE(pci, meye_pci_tbl); +static SIMPLE_DEV_PM_OPS(meye_pm_ops, meye_suspend, meye_resume); + static struct pci_driver meye_driver = { .name = "meye", .id_table = meye_pci_tbl, .probe = meye_probe, .remove = meye_remove, -#ifdef CONFIG_PM - .suspend = meye_suspend, - .resume = meye_resume, -#endif + .driver.pm = &meye_pm_ops, }; static int __init meye_init(void)