[PATCH v4 06/11] scsi: legacy: prepare to move module reference from scsi_host_template to Scsi_Host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In preparation for moving owner module reference field from struct
scsi_host_template to struct Scsi_Host, this converts scsi_register() into
macro so that legacy LLDDs can pass THIS_MODULE to scsi_host_alloc()
through it instead of scsi_host_template->module.

Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: "James E.J. Bottomley" <JBottomley@xxxxxxxxxxxxx>
Cc: linux-scsi@xxxxxxxxxxxxxxx
---
 drivers/scsi/hosts.c     | 5 +++--
 include/scsi/scsi_host.h | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 8bb173e..eb324f1 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -499,7 +499,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
 }
 EXPORT_SYMBOL(scsi_host_alloc);
 
-struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize)
+struct Scsi_Host *__scsi_register(struct scsi_host_template *sht, int privsize,
+				  struct module *owner)
 {
 	struct Scsi_Host *shost = scsi_host_alloc(sht, privsize);
 
@@ -513,7 +514,7 @@ struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize)
 		list_add_tail(&shost->sht_legacy_list, &sht->legacy_hosts);
 	return shost;
 }
-EXPORT_SYMBOL(scsi_register);
+EXPORT_SYMBOL(__scsi_register);
 
 void scsi_unregister(struct Scsi_Host *shost)
 {
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 019e668..0369b4e 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -926,7 +926,10 @@ static inline unsigned char scsi_host_get_guard(struct Scsi_Host *shost)
 }
 
 /* legacy interfaces */
-extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int);
+extern struct Scsi_Host *__scsi_register(struct scsi_host_template *, int,
+					 struct module *);
+#define scsi_register(sht, privsize) \
+	__scsi_register(sht, privsize, THIS_MODULE)
 extern void scsi_unregister(struct Scsi_Host *);
 extern int scsi_host_set_state(struct Scsi_Host *, enum scsi_host_state);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux