scsi: remove scsi_driver owner field
authorChristoph Hellwig <hch@lst.de>
Wed, 12 Nov 2014 17:34:51 +0000 (18:34 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 24 Nov 2014 19:01:28 +0000 (20:01 +0100)
The driver core driver structure has grown an owner field and now
requires it to be set for all modular drivers.  Set it up for
all scsi_driver instances and get rid of the now superflous
scsi_driver owner field.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reported-by: Shane M Seymour <shane.seymour@hp.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com
Reviewed-by: Hannes Reinecke <hare@suse.de>
drivers/scsi/ch.c
drivers/scsi/osd/osd_uld.c
drivers/scsi/osst.c
drivers/scsi/scsi_scan.c
drivers/scsi/sd.c
drivers/scsi/ses.c
drivers/scsi/sr.c
drivers/scsi/st.c
include/scsi/scsi_driver.h

index 4f502f9..6bac8a7 100644 (file)
@@ -972,9 +972,9 @@ static int ch_remove(struct device *dev)
 }
 
 static struct scsi_driver ch_template = {
-       .owner          = THIS_MODULE,
        .gendrv         = {
                .name   = "ch",
+               .owner  = THIS_MODULE,
                .probe  = ch_probe,
                .remove = ch_remove,
        },
index 92cdd4b..243eab3 100644 (file)
@@ -540,9 +540,9 @@ static int osd_remove(struct device *dev)
  */
 
 static struct scsi_driver osd_driver = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           = osd_name,
+               .owner          = THIS_MODULE,
                .probe          = osd_probe,
                .remove         = osd_remove,
        }
index 8c38464..5033223 100644 (file)
@@ -172,9 +172,9 @@ static int osst_probe(struct device *);
 static int osst_remove(struct device *);
 
 static struct scsi_driver osst_template = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           =  "osst",
+               .owner          = THIS_MODULE,
                .probe          = osst_probe,
                .remove         = osst_remove,
        }
index d97597e..0cda53a 100644 (file)
@@ -1593,16 +1593,15 @@ EXPORT_SYMBOL(scsi_add_device);
 
 void scsi_rescan_device(struct device *dev)
 {
-       struct scsi_driver *drv;
-       
        if (!dev->driver)
                return;
 
-       drv = to_scsi_driver(dev->driver);
-       if (try_module_get(drv->owner)) {
+       if (try_module_get(dev->driver->owner)) {
+               struct scsi_driver *drv = to_scsi_driver(dev->driver);
+
                if (drv->rescan)
                        drv->rescan(dev);
-               module_put(drv->owner);
+               module_put(dev->driver->owner);
        }
 }
 EXPORT_SYMBOL(scsi_rescan_device);
index f2e9b1d..54abcb2 100644 (file)
@@ -510,9 +510,9 @@ static const struct dev_pm_ops sd_pm_ops = {
 };
 
 static struct scsi_driver sd_template = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           = "sd",
+               .owner          = THIS_MODULE,
                .probe          = sd_probe,
                .remove         = sd_remove,
                .shutdown       = sd_shutdown,
index 80bfece..b7e79e7 100644 (file)
@@ -693,9 +693,9 @@ static struct class_interface ses_interface = {
 };
 
 static struct scsi_driver ses_template = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           = "ses",
+               .owner          = THIS_MODULE,
                .probe          = ses_probe,
                .remove         = ses_remove,
        },
index 5ebadc2..8bd54a6 100644 (file)
@@ -88,9 +88,9 @@ static struct dev_pm_ops sr_pm_ops = {
 };
 
 static struct scsi_driver sr_template = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           = "sr",
+               .owner          = THIS_MODULE,
                .probe          = sr_probe,
                .remove         = sr_remove,
                .pm             = &sr_pm_ops,
index e46e02b..128d3b5 100644 (file)
@@ -202,9 +202,9 @@ static int do_create_sysfs_files(void);
 static void do_remove_sysfs_files(void);
 
 static struct scsi_driver st_template = {
-       .owner                  = THIS_MODULE,
        .gendrv = {
                .name           = "st",
+               .owner          = THIS_MODULE,
                .probe          = st_probe,
                .remove         = st_remove,
        },
index c2b7598..891a658 100644 (file)
@@ -9,7 +9,6 @@ struct scsi_cmnd;
 struct scsi_device;
 
 struct scsi_driver {
-       struct module           *owner;
        struct device_driver    gendrv;
 
        void (*rescan)(struct device *);