Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/bochs: Use dev_get_drvdata

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>

authored by

Chuhong Yuan and committed by
Gerd Hoffmann
c1233578 f6d2b63a

+2 -4
+2 -4
drivers/gpu/drm/bochs/bochs_drv.c
··· 80 80 #ifdef CONFIG_PM_SLEEP 81 81 static int bochs_pm_suspend(struct device *dev) 82 82 { 83 - struct pci_dev *pdev = to_pci_dev(dev); 84 - struct drm_device *drm_dev = pci_get_drvdata(pdev); 83 + struct drm_device *drm_dev = dev_get_drvdata(dev); 85 84 86 85 return drm_mode_config_helper_suspend(drm_dev); 87 86 } 88 87 89 88 static int bochs_pm_resume(struct device *dev) 90 89 { 91 - struct pci_dev *pdev = to_pci_dev(dev); 92 - struct drm_device *drm_dev = pci_get_drvdata(pdev); 90 + struct drm_device *drm_dev = dev_get_drvdata(dev); 93 91 94 92 return drm_mode_config_helper_resume(drm_dev); 95 93 }