Olaf Hering
2011-Sep-08 16:26 UTC
[PATCH] Staging: hv: storvsc: Show the modulename in /sys/class/scsi_host/*/proc_name
mkinitrd relies on /sys/class/scsi_host/*/proc_name instead of /sys/block/sd*/device/../../../moalias to get the scsi driver module name. As a fallback the sysfs driver name could be used, which does not match the module name either ('storvsc' vs. 'hv_storvsc'). Signed-off-by: Olaf Hering <olaf at aepfle.de> --- drivers/staging/hv/storvsc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -1333,7 +1333,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman /* Scsi driver */ static struct scsi_host_template scsi_driver = { .module = THIS_MODULE, - .name = "storvsc_host_t", + .name = "hv_storvsc", + .proc_name = "hv_storvsc", .bios_param = storvsc_get_chs, .queuecommand = storvsc_queuecommand, .eh_host_reset_handler = storvsc_host_reset_handler,
KY Srinivasan
2011-Sep-08 16:55 UTC
[PATCH] Staging: hv: storvsc: Show the modulename in /sys/class/scsi_host/*/proc_name
> -----Original Message----- > From: Olaf Hering [mailto:olaf at aepfle.de] > Sent: Thursday, September 08, 2011 12:27 PM > To: KY Srinivasan > Cc: gregkh at suse.de; linux-kernel at vger.kernel.org; > devel at linuxdriverproject.org; virtualization at lists.osdl.org > Subject: [PATCH] Staging: hv: storvsc: Show the modulename in > /sys/class/scsi_host/*/proc_name > > > mkinitrd relies on /sys/class/scsi_host/*/proc_name instead of > /sys/block/sd*/device/../../../moalias to get the scsi driver module > name. > As a fallback the sysfs driver name could be used, which does not match > the module name either ('storvsc' vs. 'hv_storvsc'). > > Signed-off-by: Olaf Hering <olaf at aepfle.de> > > --- > drivers/staging/hv/storvsc_drv.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > --- a/drivers/staging/hv/storvsc_drv.c > +++ b/drivers/staging/hv/storvsc_drv.c > @@ -1333,7 +1333,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman > /* Scsi driver */ > static struct scsi_host_template scsi_driver = { > .module = THIS_MODULE, > - .name = "storvsc_host_t", > + .name = "hv_storvsc", > + .proc_name = "hv_storvsc", > .bios_param = storvsc_get_chs, > .queuecommand = storvsc_queuecommand, > .eh_host_reset_handler = storvsc_host_reset_handler,Acked-by: K. Y. Srinivasan <kys at microsoft.com>
Greg KH
2011-Sep-08 19:12 UTC
[PATCH] Staging: hv: storvsc: Show the modulename in /sys/class/scsi_host/*/proc_name
On Thu, Sep 08, 2011 at 06:26:50PM +0200, Olaf Hering wrote:> > mkinitrd relies on /sys/class/scsi_host/*/proc_name instead of > /sys/block/sd*/device/../../../moalias to get the scsi driver module > name. > As a fallback the sysfs driver name could be used, which does not match > the module name either ('storvsc' vs. 'hv_storvsc'). > > Signed-off-by: Olaf Hering <olaf at aepfle.de> > > --- > drivers/staging/hv/storvsc_drv.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > --- a/drivers/staging/hv/storvsc_drv.c > +++ b/drivers/staging/hv/storvsc_drv.c > @@ -1333,7 +1333,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman > /* Scsi driver */ > static struct scsi_host_template scsi_driver = { > .module = THIS_MODULE, > - .name = "storvsc_host_t", > + .name = "hv_storvsc", > + .proc_name = "hv_storvsc",Shouldn't this be MODULE_NAME so it handles any potential name change in the future and makes it a bit more obvious as to what is going on here? thanks, greg k-h
Olaf Hering
2011-Sep-09 12:45 UTC
[PATCH] Staging: hv: storvsc: advertise hv_storvsc instead of storvsc as driver name
Signed-off-by: Olaf Hering <olaf at aepfle.de> --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c @@ -42,6 +42,8 @@ #include "hyperv.h" +#define MODULE_NAME "hv_storvsc" + #define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE) static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE; @@ -1164,7 +1166,7 @@ static void storvsc_command_completion(s if (scmnd->result) { if (scsi_normalize_sense(scmnd->sense_buffer, SCSI_SENSE_BUFFERSIZE, &sense_hdr)) - scsi_print_sense_hdr("storvsc", &sense_hdr); + scsi_print_sense_hdr(MODULE_NAME, &sense_hdr); } scsi_set_resid(scmnd, @@ -1333,8 +1335,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman /* Scsi driver */ static struct scsi_host_template scsi_driver = { .module = THIS_MODULE, - .name = "hv_storvsc", - .proc_name = "hv_storvsc", + .name = MODULE_NAME, + .proc_name = MODULE_NAME, .bios_param = storvsc_get_chs, .queuecommand = storvsc_queuecommand, .eh_host_reset_handler = storvsc_host_reset_handler, @@ -1468,7 +1470,7 @@ err_out: /* The one and only one */ static struct hv_driver storvsc_drv = { - .name = "storvsc", + .name = MODULE_NAME, .id_table = id_table, .probe = storvsc_probe, .remove = storvsc_remove,
Olaf Hering
2011-Sep-09 12:46 UTC
[PATCH] Staging: hv: netvsc: advertise hv_netvsc instead of netvsc as driver name
Signed-off-by: Olaf Hering <olaf at aepfle.de> --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c @@ -41,6 +41,8 @@ #include "hyperv.h" #include "hyperv_net.h" +#define MODULE_NAME "hv_netvsc" + struct net_device_context { /* point back to our device context */ struct hv_device *device_ctx; @@ -291,7 +293,7 @@ int netvsc_recv_callback(struct hv_devic static void netvsc_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info) { - strcpy(info->driver, "hv_netvsc"); + strcpy(info->driver, MODULE_NAME); strcpy(info->version, HV_DRV_VERSION); strcpy(info->fw_version, "N/A"); } @@ -420,7 +422,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table); /* The one and only one */ static struct hv_driver netvsc_drv = { - .name = "netvsc", + .name = MODULE_NAME, .id_table = id_table, .probe = netvsc_probe, .remove = netvsc_remove,
Reasonably Related Threads
- [PATCH] Staging: hv: storvsc: Show the modulename in /sys/class/scsi_host/*/proc_name
- [PATCH 1/1] staging: hv: Add support for >2 TB LUN in storage driver.
- [PATCH 1/1] staging: hv: Add support for >2 TB LUN in storage driver.
- Citrix Project Satori and 2.6.32-7
- INITRD_MODULES