media: atomisp: don't pass struct device_driver as parameter
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 26 Jun 2020 12:19:14 +0000 (14:19 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 18 Jul 2020 05:18:58 +0000 (07:18 +0200)
There is no need to pass a pointer to struct device_driver
when we have an access to struct device already.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_drvfs.c
drivers/staging/media/atomisp/pci/atomisp_drvfs.h
drivers/staging/media/atomisp/pci/atomisp_v4l2.c

index fe0e2bf..3711df1 100644 (file)
@@ -185,8 +185,9 @@ static void iunit_drvfs_remove_files(struct device_driver *drv)
                driver_remove_file(drv, &iunit_drvfs_attrs[i]);
 }
 
-int atomisp_drvfs_init(struct device_driver *drv, struct atomisp_device *isp)
+int atomisp_drvfs_init(struct atomisp_device *isp)
 {
+       struct device_driver *drv = isp->dev->driver;
        int ret;
 
        iunit_debug.isp = isp;
index 4911037..8f4cc72 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef        __ATOMISP_DRVFS_H__
 #define        __ATOMISP_DRVFS_H__
 
-int atomisp_drvfs_init(struct device_driver *drv, struct atomisp_device *isp);
+int atomisp_drvfs_init(struct atomisp_device *isp);
 void atomisp_drvfs_exit(void);
 
 #endif /* __ATOMISP_DRVFS_H__ */
index 3bd78d8..9214c68 100644 (file)
@@ -1840,7 +1840,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
        isp->firmware = NULL;
        isp->css_env.isp_css_fw.data = NULL;
 
-       atomisp_drvfs_init(&dev->driver->driver, isp);
+       atomisp_drvfs_init(isp);
 
        return 0;