Skip to content

Commit 267173c

Browse files
bjorn-helgaashdeller
authored andcommitted
video: fbdev: skeletonfb: Convert to generic power management
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 <[email protected]> Acked-by: Daniel Vetter <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent e146a09 commit 267173c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

drivers/video/fbdev/skeletonfb.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,9 @@ static void xxxfb_remove(struct pci_dev *dev)
838838
*
839839
* See Documentation/driver-api/pm/devices.rst for more information
840840
*/
841-
static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
841+
static int xxxfb_suspend(struct device *dev)
842842
{
843-
struct fb_info *info = pci_get_drvdata(dev);
843+
struct fb_info *info = dev_get_drvdata(dev);
844844
struct xxxfb_par *par = info->par;
845845

846846
/* suspend here */
@@ -853,9 +853,9 @@ static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
853853
*
854854
* See Documentation/driver-api/pm/devices.rst for more information
855855
*/
856-
static int xxxfb_resume(struct pci_dev *dev)
856+
static int xxxfb_resume(struct device *dev)
857857
{
858-
struct fb_info *info = pci_get_drvdata(dev);
858+
struct fb_info *info = dev_get_drvdata(dev);
859859
struct xxxfb_par *par = info->par;
860860

861861
/* resume here */
@@ -873,14 +873,15 @@ static const struct pci_device_id xxxfb_id_table[] = {
873873
{ 0, }
874874
};
875875

876+
static SIMPLE_DEV_PM_OPS(xxxfb_pm_ops, xxxfb_suspend, xxxfb_resume);
877+
876878
/* For PCI drivers */
877879
static struct pci_driver xxxfb_driver = {
878880
.name = "xxxfb",
879881
.id_table = xxxfb_id_table,
880882
.probe = xxxfb_probe,
881883
.remove = xxxfb_remove,
882-
.suspend = xxxfb_suspend, /* optional but recommended */
883-
.resume = xxxfb_resume, /* optional but recommended */
884+
.driver.pm = xxxfb_pm_ops, /* optional but recommended */
884885
};
885886

886887
MODULE_DEVICE_TABLE(pci, xxxfb_id_table);

0 commit comments

Comments
 (0)