drm/bochs: Use dev_get_drvdata
authorChuhong Yuan <hslester96@gmail.com>
Tue, 23 Jul 2019 10:11:04 +0000 (18:11 +0800)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 6 Aug 2019 07:20:58 +0000 (09:20 +0200)
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190723101103.30250-1-hslester96@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/bochs/bochs_drv.c

index 46d8312ec00d3650cf1df8c3c29811aebde7f0ee..770e1625d05ef5d1d4cd3272c9f8184d13ddb532 100644 (file)
@@ -80,16 +80,14 @@ static struct drm_driver bochs_driver = {
 #ifdef CONFIG_PM_SLEEP
 static int bochs_pm_suspend(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct drm_device *drm_dev = pci_get_drvdata(pdev);
+       struct drm_device *drm_dev = dev_get_drvdata(dev);
 
        return drm_mode_config_helper_suspend(drm_dev);
 }
 
 static int bochs_pm_resume(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct drm_device *drm_dev = pci_get_drvdata(pdev);
+       struct drm_device *drm_dev = dev_get_drvdata(dev);
 
        return drm_mode_config_helper_resume(drm_dev);
 }