Skip to contentSkip to conversation

hwmon: Fix autoloading of fschmd on recent Fujitsu machines

PATCH In review Jean Delvare 2 participants 2 messages Jul 8, 2010 – Jul 10, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Fix autoloading of fschmd on recent Fujitsu machines

Fujitsu slightly changed the DMI strings in their recent machines, (for example the D2778) and this breaks the automatic loading of the needed fschmd driver. Being more tolerant on string comparison fixes the issue.

This closes bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634

---
 drivers/i2c/busses/i2c-i801.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-i801.c +2 -6
@@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_
 		/* & ~0x80, ignore enabled/disabled bit */
 		if ((type & ~0x80) != dmi_devices[i].type)
 			continue;
-		if (strcmp(name, dmi_devices[i].name))
+		if (strcasecmp(name, dmi_devices[i].name))
 			continue;
 
 		memset(&info, 0, sizeof(struct i2c_board_info));
@@ -704,9 +704,6 @@ static int __devinit i801_probe(struct p
 {
 	unsigned char temp;
 	int err, i;
-#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
-	const char *vendor;
-#endif
 
 	I801_dev = dev;
 	i801_features = 0;
@@ -808,8 +805,7 @@ static int __devinit i801_probe(struct p
 	}
 #endif
 #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
-	vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
-	if (vendor && !strcmp(vendor, "FUJITSU SIEMENS"))
+	if (dmi_name_in_vendors("FUJITSU"))
 		dmi_walk(dmi_check_onboard_devices, &i801_adapter);
 #endif
 
Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by
#2 lore raw

Hi Jean,

Thanks for the patch it looks good, and this makes sense as FUJITSU SIEMENS no longer is a co-operation between FUJITSU and SIEMENS, so now it is just called FUJITSU,

Regards,

Hans

Quoted 48 lines · Jean Delvare

Fujitsu slightly changed the DMI strings in their recent machines, (for example the D2778) and this breaks the automatic loading of the needed fschmd driver. Being more tolerant on string comparison fixes the issue.

This closes bug #15634:
https://bugzilla.kernel.org/show_bug.cgi?id=15634

---
  drivers/i2c/busses/i2c-i801.c |    8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-i801.c +2 -6
@@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_
  		/*&  ~0x80, ignore enabled/disabled bit */
  		if ((type&  ~0x80) != dmi_devices[i].type)
  			continue;
-		if (strcmp(name, dmi_devices[i].name))
+		if (strcasecmp(name, dmi_devices[i].name))
  			continue;
 
  		memset(&info, 0, sizeof(struct i2c_board_info));
@@ -704,9 +704,6 @@ static int __devinit i801_probe(struct p
  {
  	unsigned char temp;
  	int err, i;
-#if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
-	const char *vendor;
-#endif
 
  	I801_dev = dev;
  	i801_features = 0;
@@ -808,8 +805,7 @@ static int __devinit i801_probe(struct p
  	}
  #endif
  #if defined CONFIG_SENSORS_FSCHMD || defined CONFIG_SENSORS_FSCHMD_MODULE
-	vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
-	if (vendor&&  !strcmp(vendor, "FUJITSU SIEMENS"))
+	if (dmi_name_in_vendors("FUJITSU"))
  		dmi_walk(dmi_check_onboard_devices,&i801_adapter);
  #endif