From: Chuhong Yuan Date: Tue, 23 Jul 2019 10:11:04 +0000 (+0800) Subject: drm/bochs: Use dev_get_drvdata X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c1233578a2b9db920ecd9b647797967ac68dfe46;p=openwrt%2Fstaging%2Fblogic.git 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 Link: http://patchwork.freedesktop.org/patch/msgid/20190723101103.30250-1-hslester96@gmail.com Signed-off-by: Gerd Hoffmann --- diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 46d8312ec00d..770e1625d05e 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -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); }