From: Peter Jones Subject: [PATCH 2/3] scsi_dh: Change scsi device handler modules to utilize modalias This patch changes the scsi_dh files to make use of the modalias feature. Signed-off-by: Peter Jones Signed-off-by: Chandra Seetharaman --- drivers/scsi/device_handler/scsi_dh.c | 4 - drivers/scsi/device_handler/scsi_dh_alua.c | 33 +++++++------ drivers/scsi/device_handler/scsi_dh_emc.c | 11 ++-- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 13 ++--- drivers/scsi/device_handler/scsi_dh_rdac.c | 67 ++++++++++++++-------------- 5 files changed, 66 insertions(+), 62 deletions(-) Index: linux-2.6/drivers/scsi/device_handler/scsi_dh.c =================================================================== --- linux-2.6.orig/drivers/scsi/device_handler/scsi_dh.c +++ linux-2.6/drivers/scsi/device_handler/scsi_dh.c @@ -327,7 +327,7 @@ int scsi_register_device_handler(struct list_add(&scsi_dh->list, &scsi_dh_list); spin_unlock(&list_lock); - for (i = 0; scsi_dh->devlist[i].vendor; i++) { + for (i = 0; scsi_dh->devlist[i].vendor[0]; i++) { scsi_dev_info_list_add_keyed(0, scsi_dh->devlist[i].vendor, scsi_dh->devlist[i].model, @@ -360,7 +360,7 @@ int scsi_unregister_device_handler(struc bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, scsi_dh_notifier_remove); - for (i = 0; scsi_dh->devlist[i].vendor; i++) { + for (i = 0; scsi_dh->devlist[i].vendor[0]; i++) { scsi_dev_info_list_del_keyed(scsi_dh->devlist[i].vendor, scsi_dh->devlist[i].model, SCSI_DEVINFO_DH); Index: linux-2.6/drivers/scsi/device_handler/scsi_dh_alua.c =================================================================== --- linux-2.6.orig/drivers/scsi/device_handler/scsi_dh_alua.c +++ linux-2.6/drivers/scsi/device_handler/scsi_dh_alua.c @@ -720,23 +720,24 @@ static int alua_prep_fn(struct scsi_devi } -static const struct scsi_dh_devlist alua_dev_list[] = { - {"HP", "MSA VOLUME" }, - {"HP", "HSV101" }, - {"HP", "HSV111" }, - {"HP", "HSV200" }, - {"HP", "HSV210" }, - {"HP", "HSV300" }, - {"IBM", "2107900" }, - {"IBM", "2145" }, - {"Pillar", "Axiom" }, - {"Intel", "Multi-Flex"}, - {"NETAPP", "LUN"}, - {"NETAPP", "LUN C-Mode"}, - {"AIX", "NVDISK"}, - {"Promise", "VTrak"}, - {NULL, NULL} +static const struct scsi_dh_device_id alua_dev_list[] = { + {TYPE_ANY, "HP", "MSA VOLUME" }, + {TYPE_ANY, "HP", "HSV101" }, + {TYPE_ANY, "HP", "HSV111" }, + {TYPE_ANY, "HP", "HSV200" }, + {TYPE_ANY, "HP", "HSV210" }, + {TYPE_ANY, "HP", "HSV300" }, + {TYPE_ANY, "IBM", "2107900" }, + {TYPE_ANY, "IBM", "2145" }, + {TYPE_ANY, "Pillar", "Axiom" }, + {TYPE_ANY, "Intel", "Multi-Flex"}, + {TYPE_ANY, "NETAPP", "LUN"}, + {TYPE_ANY, "NETAPP", "LUN C-Mode"}, + {TYPE_ANY, "AIX", "NVDISK"}, + {TYPE_ANY, "Promise", "VTrak"}, + {0, "", ""} }; +MODULE_DEVICE_TABLE(scsi_dh, alua_dev_list); static int alua_bus_attach(struct scsi_device *sdev); static void alua_bus_detach(struct scsi_device *sdev); Index: linux-2.6/drivers/scsi/device_handler/scsi_dh_emc.c =================================================================== --- linux-2.6.orig/drivers/scsi/device_handler/scsi_dh_emc.c +++ linux-2.6/drivers/scsi/device_handler/scsi_dh_emc.c @@ -621,12 +621,13 @@ done: return result; } -static const struct scsi_dh_devlist clariion_dev_list[] = { - {"DGC", "RAID"}, - {"DGC", "DISK"}, - {"DGC", "VRAID"}, - {NULL, NULL}, +static const struct scsi_dh_device_id clariion_dev_list[] = { + {TYPE_ANY, "DGC", "RAID"}, + {TYPE_ANY, "DGC", "DISK"}, + {TYPE_ANY, "DGC", "VRAID"}, + {0, "", ""}, }; +MODULE_DEVICE_TABLE(scsi_dh, clariion_dev_list); static int clariion_bus_attach(struct scsi_device *sdev); static void clariion_bus_detach(struct scsi_device *sdev); Index: linux-2.6/drivers/scsi/device_handler/scsi_dh_hp_sw.c =================================================================== --- linux-2.6.orig/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ linux-2.6/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -311,13 +311,14 @@ static int hp_sw_activate(struct scsi_de return 0; } -static const struct scsi_dh_devlist hp_sw_dh_data_list[] = { - {"COMPAQ", "MSA1000 VOLUME"}, - {"COMPAQ", "HSV110"}, - {"HP", "HSV100"}, - {"DEC", "HSG80"}, - {NULL, NULL}, +static const struct scsi_dh_device_id hp_sw_dh_data_list[] = { + {TYPE_ANY, "COMPAQ", "MSA1000 VOLUME"}, + {TYPE_ANY, "COMPAQ", "HSV110"}, + {TYPE_ANY, "HP", "HSV100"}, + {TYPE_ANY, "DEC", "HSG80"}, + {0, "", ""}, }; +MODULE_DEVICE_TABLE(scsi_dh, hp_sw_dh_data_list); static int hp_sw_bus_attach(struct scsi_device *sdev); static void hp_sw_bus_detach(struct scsi_device *sdev); Index: linux-2.6/drivers/scsi/device_handler/scsi_dh_rdac.c =================================================================== --- linux-2.6.orig/drivers/scsi/device_handler/scsi_dh_rdac.c +++ linux-2.6/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -742,40 +742,41 @@ static int rdac_check_sense(struct scsi_ return SCSI_RETURN_NOT_HANDLED; } -static const struct scsi_dh_devlist rdac_dev_list[] = { - {"IBM", "1722"}, - {"IBM", "1724"}, - {"IBM", "1726"}, - {"IBM", "1742"}, - {"IBM", "1745"}, - {"IBM", "1746"}, - {"IBM", "1814"}, - {"IBM", "1815"}, - {"IBM", "1818"}, - {"IBM", "3526"}, - {"SGI", "TP9400"}, - {"SGI", "TP9500"}, - {"SGI", "IS"}, - {"STK", "OPENstorage D280"}, - {"SUN", "CSM200_R"}, - {"SUN", "LCSM100_I"}, - {"SUN", "LCSM100_S"}, - {"SUN", "LCSM100_E"}, - {"SUN", "LCSM100_F"}, - {"DELL", "MD3000"}, - {"DELL", "MD3000i"}, - {"DELL", "MD32xx"}, - {"DELL", "MD32xxi"}, - {"DELL", "MD36xxi"}, - {"DELL", "MD36xxf"}, - {"LSI", "INF-01-00"}, - {"ENGENIO", "INF-01-00"}, - {"STK", "FLEXLINE 380"}, - {"SUN", "CSM100_R_FC"}, - {"SUN", "STK6580_6780"}, - {"SUN", "SUN_6180"}, - {NULL, NULL}, +static const struct scsi_dh_device_id rdac_dev_list[] = { + {TYPE_ANY, "IBM", "1722"}, + {TYPE_ANY, "IBM", "1724"}, + {TYPE_ANY, "IBM", "1726"}, + {TYPE_ANY, "IBM", "1742"}, + {TYPE_ANY, "IBM", "1745"}, + {TYPE_ANY, "IBM", "1746"}, + {TYPE_ANY, "IBM", "1814"}, + {TYPE_ANY, "IBM", "1815"}, + {TYPE_ANY, "IBM", "1818"}, + {TYPE_ANY, "IBM", "3526"}, + {TYPE_ANY, "SGI", "TP9400"}, + {TYPE_ANY, "SGI", "TP9500"}, + {TYPE_ANY, "SGI", "IS"}, + {TYPE_ANY, "STK", "OPENstorage D280"}, + {TYPE_ANY, "SUN", "CSM200_R"}, + {TYPE_ANY, "SUN", "LCSM100_I"}, + {TYPE_ANY, "SUN", "LCSM100_S"}, + {TYPE_ANY, "SUN", "LCSM100_E"}, + {TYPE_ANY, "SUN", "LCSM100_F"}, + {TYPE_ANY, "DELL", "MD3000"}, + {TYPE_ANY, "DELL", "MD3000i"}, + {TYPE_ANY, "DELL", "MD32xx"}, + {TYPE_ANY, "DELL", "MD32xxi"}, + {TYPE_ANY, "DELL", "MD36xxi"}, + {TYPE_ANY, "DELL", "MD36xxf"}, + {TYPE_ANY, "LSI", "INF-01-00"}, + {TYPE_ANY, "ENGENIO", "INF-01-00"}, + {TYPE_ANY, "STK", "FLEXLINE 380"}, + {TYPE_ANY, "SUN", "CSM100_R_FC"}, + {TYPE_ANY, "SUN", "STK6580_6780"}, + {TYPE_ANY, "SUN", "SUN_6180"}, + {0 , "", ""}, }; +MODULE_DEVICE_TABLE(scsi_dh, rdac_dev_list); static int rdac_bus_attach(struct scsi_device *sdev); static void rdac_bus_detach(struct scsi_device *sdev);