drm/hisilicon: Use dev_get_drvdata
authorChuhong Yuan <hslester96@gmail.com>
Tue, 23 Jul 2019 10:38:53 +0000 (18:38 +0800)
committerXinliang Liu <z.liuxinliang@hisilicon.com>
Mon, 26 Aug 2019 07:21:33 +0000 (15:21 +0800)
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>
Signed-off-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c

index 5a9fa8783a4dc2ae7bcb74cf9a1c05c501c5461c..c103005b0a33e440592766e2fdd298ad6a7431c1 100644 (file)
@@ -66,16 +66,14 @@ static struct drm_driver hibmc_driver = {
 
 static int __maybe_unused hibmc_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  __maybe_unused hibmc_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);
 }