瀏覽代碼

scsi: remove scsi_driver owner field

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>
Christoph Hellwig 10 年之前
父節點
當前提交
3af6b35261
共有 9 個文件被更改,包括 11 次插入13 次删除
  1. 1 1
      drivers/scsi/ch.c
  2. 1 1
      drivers/scsi/osd/osd_uld.c
  3. 1 1
      drivers/scsi/osst.c
  4. 4 5
      drivers/scsi/scsi_scan.c
  5. 1 1
      drivers/scsi/sd.c
  6. 1 1
      drivers/scsi/ses.c
  7. 1 1
      drivers/scsi/sr.c
  8. 1 1
      drivers/scsi/st.c
  9. 0 1
      include/scsi/scsi_driver.h

+ 1 - 1
drivers/scsi/ch.c

@@ -972,9 +972,9 @@ static int ch_remove(struct device *dev)
 }
 }
 
 
 static struct scsi_driver ch_template = {
 static struct scsi_driver ch_template = {
-	.owner     	= THIS_MODULE,
 	.gendrv     	= {
 	.gendrv     	= {
 		.name	= "ch",
 		.name	= "ch",
+		.owner	= THIS_MODULE,
 		.probe  = ch_probe,
 		.probe  = ch_probe,
 		.remove = ch_remove,
 		.remove = ch_remove,
 	},
 	},

+ 1 - 1
drivers/scsi/osd/osd_uld.c

@@ -540,9 +540,9 @@ static int osd_remove(struct device *dev)
  */
  */
 
 
 static struct scsi_driver osd_driver = {
 static struct scsi_driver osd_driver = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name		= osd_name,
 		.name		= osd_name,
+		.owner		= THIS_MODULE,
 		.probe		= osd_probe,
 		.probe		= osd_probe,
 		.remove		= osd_remove,
 		.remove		= osd_remove,
 	}
 	}

+ 1 - 1
drivers/scsi/osst.c

@@ -172,9 +172,9 @@ static int osst_probe(struct device *);
 static int osst_remove(struct device *);
 static int osst_remove(struct device *);
 
 
 static struct scsi_driver osst_template = {
 static struct scsi_driver osst_template = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name		=  "osst",
 		.name		=  "osst",
+		.owner		= THIS_MODULE,
 		.probe		= osst_probe,
 		.probe		= osst_probe,
 		.remove		= osst_remove,
 		.remove		= osst_remove,
 	}
 	}

+ 4 - 5
drivers/scsi/scsi_scan.c

@@ -1593,16 +1593,15 @@ EXPORT_SYMBOL(scsi_add_device);
 
 
 void scsi_rescan_device(struct device *dev)
 void scsi_rescan_device(struct device *dev)
 {
 {
-	struct scsi_driver *drv;
-	
 	if (!dev->driver)
 	if (!dev->driver)
 		return;
 		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)
 		if (drv->rescan)
 			drv->rescan(dev);
 			drv->rescan(dev);
-		module_put(drv->owner);
+		module_put(dev->driver->owner);
 	}
 	}
 }
 }
 EXPORT_SYMBOL(scsi_rescan_device);
 EXPORT_SYMBOL(scsi_rescan_device);

+ 1 - 1
drivers/scsi/sd.c

@@ -510,9 +510,9 @@ static const struct dev_pm_ops sd_pm_ops = {
 };
 };
 
 
 static struct scsi_driver sd_template = {
 static struct scsi_driver sd_template = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name		= "sd",
 		.name		= "sd",
+		.owner		= THIS_MODULE,
 		.probe		= sd_probe,
 		.probe		= sd_probe,
 		.remove		= sd_remove,
 		.remove		= sd_remove,
 		.shutdown	= sd_shutdown,
 		.shutdown	= sd_shutdown,

+ 1 - 1
drivers/scsi/ses.c

@@ -693,9 +693,9 @@ static struct class_interface ses_interface = {
 };
 };
 
 
 static struct scsi_driver ses_template = {
 static struct scsi_driver ses_template = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name		= "ses",
 		.name		= "ses",
+		.owner		= THIS_MODULE,
 		.probe		= ses_probe,
 		.probe		= ses_probe,
 		.remove		= ses_remove,
 		.remove		= ses_remove,
 	},
 	},

+ 1 - 1
drivers/scsi/sr.c

@@ -88,9 +88,9 @@ static struct dev_pm_ops sr_pm_ops = {
 };
 };
 
 
 static struct scsi_driver sr_template = {
 static struct scsi_driver sr_template = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name   	= "sr",
 		.name   	= "sr",
+		.owner		= THIS_MODULE,
 		.probe		= sr_probe,
 		.probe		= sr_probe,
 		.remove		= sr_remove,
 		.remove		= sr_remove,
 		.pm		= &sr_pm_ops,
 		.pm		= &sr_pm_ops,

+ 1 - 1
drivers/scsi/st.c

@@ -202,9 +202,9 @@ static int do_create_sysfs_files(void);
 static void do_remove_sysfs_files(void);
 static void do_remove_sysfs_files(void);
 
 
 static struct scsi_driver st_template = {
 static struct scsi_driver st_template = {
-	.owner			= THIS_MODULE,
 	.gendrv = {
 	.gendrv = {
 		.name		= "st",
 		.name		= "st",
+		.owner		= THIS_MODULE,
 		.probe		= st_probe,
 		.probe		= st_probe,
 		.remove		= st_remove,
 		.remove		= st_remove,
 	},
 	},

+ 0 - 1
include/scsi/scsi_driver.h

@@ -9,7 +9,6 @@ struct scsi_cmnd;
 struct scsi_device;
 struct scsi_device;
 
 
 struct scsi_driver {
 struct scsi_driver {
-	struct module		*owner;
 	struct device_driver	gendrv;
 	struct device_driver	gendrv;
 
 
 	void (*rescan)(struct device *);
 	void (*rescan)(struct device *);