From patchwork Tue Jun 7 23:11:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 580533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99DFECCA47C for ; Wed, 8 Jun 2022 01:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229964AbiFHBDJ (ORCPT ); Tue, 7 Jun 2022 21:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1588478AbiFGXym (ORCPT ); Tue, 7 Jun 2022 19:54:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FECA47075; Tue, 7 Jun 2022 16:11:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A4A461745; Tue, 7 Jun 2022 23:11:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E9DCC3411E; Tue, 7 Jun 2022 23:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654643479; bh=y+QVg0F3fAIYsNxlSyZ9c31L5KgrkSOzkMmIiNJ4tBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J708mHBcV3ASHhE64eucN/0OCRphrtgeh9kQjlGhSOT4U0ZFoUwBXKyPChkTBPfxA ngybZp2fvbz4/wudpP1WJxvoCNDimmb6mbgkZbqy2q+gO+Nz2gAqPM55dQGq1aExVM LidHotx7s6IOD0qTW0RFSluJ9NT5PSFwO2ljiECXNMOQcx/9bhkEyszMDuyyckSK0X 15EyOC0uyANxJSj9C1Xq9vPm6nwT4mxLoyZD6+9m+202W7iJcIQ1FWjxLzP/J3CnPp AzWyeBFiQ0pwINv6cS72lOUOISDxHl1PKxKVwHgGeIN8NbHEMnD3cF1GpRirUsubQ4 QbS0GdsPbc4KA== From: Bjorn Helgaas To: Helge Deller Cc: Vaibhav Gupta , "Rafael J . Wysocki" , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 1/2] video: fbdev: cirrusfb: Remove useless reference to PCI power management Date: Tue, 7 Jun 2022 18:11:11 -0500 Message-Id: <20220607231112.354165-2-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607231112.354165-1-helgaas@kernel.org> References: <20220607231112.354165-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Bjorn Helgaas PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. The cirrusfb driver has never implemented power management at all, but if it ever does, it should use the generic power management framework, not the PCI-specific hooks. Remove the commented-out references to the PCI-specific power management hooks. Signed-off-by: Bjorn Helgaas --- drivers/video/fbdev/cirrusfb.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/video/fbdev/cirrusfb.c b/drivers/video/fbdev/cirrusfb.c index 3d47c347b897..51e072c03e1c 100644 --- a/drivers/video/fbdev/cirrusfb.c +++ b/drivers/video/fbdev/cirrusfb.c @@ -2184,12 +2184,6 @@ static struct pci_driver cirrusfb_pci_driver = { .id_table = cirrusfb_pci_table, .probe = cirrusfb_pci_register, .remove = cirrusfb_pci_unregister, -#ifdef CONFIG_PM -#if 0 - .suspend = cirrusfb_pci_suspend, - .resume = cirrusfb_pci_resume, -#endif -#endif }; #endif /* CONFIG_PCI */ From patchwork Tue Jun 7 23:11:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 580149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DC7ACCA485 for ; Wed, 8 Jun 2022 01:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239855AbiFHBDP (ORCPT ); Tue, 7 Jun 2022 21:03:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1588482AbiFGXym (ORCPT ); Tue, 7 Jun 2022 19:54:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88BCEF045; Tue, 7 Jun 2022 16:11:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 41DA96164B; Tue, 7 Jun 2022 23:11:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10924C3411C; Tue, 7 Jun 2022 23:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654643482; bh=q/o80BpaLgRq9iVSp9QC1eQiLILACxZY1sBOydVH6c4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSdiaQ8MPODZjy5tDCOevIDkXOoy9Rr3/RmUG+ckiC5TfPZsA1nM06aziSbFsTNRs jiczumAUXXeAqcsQUKVCqrNEiTOzLsAxvVlaofM0VxH86Mk0rncLhIjSpRjVaOA8pV yBgMr53BFgdhKNzguNpDfTAt/XgQ4ggsAlzKmN7WzwC+EIF6+rUJ1WDYsL4w0b/7oX 3zS16NTTje4k6E60swxizXIxmNAmlj5otazvKI8Ll3RxrDKTAwZtueLgqgMcUl1owK QaplqBmQsZGJuh6XDxembUwbwKeh391b2pG1oj0ENjoN9Lg9pjqvdYCHFV0YlPuytd CNin5j+D8q3cQ== From: Bjorn Helgaas To: Helge Deller Cc: Vaibhav Gupta , "Rafael J . Wysocki" , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 2/2] video: fbdev: skeletonfb: Convert to generic power management Date: Tue, 7 Jun 2022 18:11:12 -0500 Message-Id: <20220607231112.354165-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607231112.354165-1-helgaas@kernel.org> References: <20220607231112.354165-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Bjorn Helgaas PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. If drivers implement power management, they should use the generic power management framework, not the PCI-specific hooks. Convert the sample code to use the generic power management framework. Signed-off-by: Bjorn Helgaas --- drivers/video/fbdev/skeletonfb.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/skeletonfb.c b/drivers/video/fbdev/skeletonfb.c index bcacfb6934fa..70ba78450837 100644 --- a/drivers/video/fbdev/skeletonfb.c +++ b/drivers/video/fbdev/skeletonfb.c @@ -838,9 +838,9 @@ static void xxxfb_remove(struct pci_dev *dev) * * See Documentation/driver-api/pm/devices.rst for more information */ -static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg) +static int xxxfb_suspend(struct device *dev) { - struct fb_info *info = pci_get_drvdata(dev); + struct fb_info *info = dev_get_drvdata(dev); struct xxxfb_par *par = info->par; /* suspend here */ @@ -853,9 +853,9 @@ static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg) * * See Documentation/driver-api/pm/devices.rst for more information */ -static int xxxfb_resume(struct pci_dev *dev) +static int xxxfb_resume(struct device *dev) { - struct fb_info *info = pci_get_drvdata(dev); + struct fb_info *info = dev_get_drvdata(dev); struct xxxfb_par *par = info->par; /* resume here */ @@ -873,14 +873,15 @@ static const struct pci_device_id xxxfb_id_table[] = { { 0, } }; +static SIMPLE_DEV_PM_OPS(xxxfb_pm_ops, xxxfb_suspend, xxxfb_resume); + /* For PCI drivers */ static struct pci_driver xxxfb_driver = { .name = "xxxfb", .id_table = xxxfb_id_table, .probe = xxxfb_probe, .remove = xxxfb_remove, - .suspend = xxxfb_suspend, /* optional but recommended */ - .resume = xxxfb_resume, /* optional but recommended */ + .driver.pm = xxxfb_pm_ops, /* optional but recommended */ }; MODULE_DEVICE_TABLE(pci, xxxfb_id_table);