From faabd47f7e3a36574abcdff0b3506abb092bbe24 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 9 Jul 2010 16:22:51 +0200 Subject: 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 Signed-off-by: Jean Delvare Tested-by: Sergey Spiridonov Cc: Hans de Goede --- drivers/i2c/busses/i2c-i801.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index f4b21f2bb8ed..c60081169cc3 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -655,7 +655,7 @@ static void __devinit dmi_check_onboard_device(u8 type, const char *name, /* & ~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 pci_dev *dev, { 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 pci_dev *dev, } #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 -- cgit v1.2.3 From 827900c55665dc8e20b05bb18d3f6e078eaa6183 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 10 Jul 2010 09:42:46 +0200 Subject: i2c: Fix probability check The new unified probing function differs from the original code, and the preliminary test whether probing is possible must be updated accordingly. Signed-off-by: Jean Delvare --- drivers/i2c/i2c-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 1cca2631e5b3..0815e10da7c6 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -1428,13 +1428,12 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver) if (!(adapter->class & driver->class)) goto exit_free; - /* Stop here if we can't use SMBUS_QUICK */ - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_QUICK)) { + /* Stop here if the bus doesn't support probing */ + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_READ_BYTE)) { if (address_list[0] == I2C_CLIENT_END) goto exit_free; - dev_warn(&adapter->dev, "SMBus Quick command not supported, " - "can't probe for chips\n"); + dev_warn(&adapter->dev, "Probing not supported\n"); err = -EOPNOTSUPP; goto exit_free; } -- cgit v1.2.3 From 102b59c6d6d30fb6560177fd1ae8a34c4c163897 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 10 Jul 2010 09:42:47 +0200 Subject: i2c/mips: Fix error return codes from Sibyte i2c bus driver Sibyte i2c bus driver returns non-descriptive error values. Update to return error values as defined in Documentation/i2c/fault-codes. Signed-off-by: Guenter Roeck Signed-off-by: Jean Delvare --- drivers/i2c/busses/i2c-sibyte.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/busses/i2c-sibyte.c b/drivers/i2c/busses/i2c-sibyte.c index 3d76a188e42f..0fe505d7abe9 100644 --- a/drivers/i2c/busses/i2c-sibyte.c +++ b/drivers/i2c/busses/i2c-sibyte.c @@ -94,7 +94,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, } break; default: - return -1; /* XXXKW better error code? */ + return -EOPNOTSUPP; } while (csr_in32(SMB_CSR(adap, R_SMB_STATUS)) & M_SMB_BUSY) @@ -104,7 +104,7 @@ static int smbus_xfer(struct i2c_adapter *i2c_adap, u16 addr, if (error & M_SMB_ERROR) { /* Clear error bit by writing a 1 */ csr_out32(M_SMB_ERROR, SMB_CSR(adap, R_SMB_STATUS)); - return -1; /* XXXKW better error code? */ + return (error & M_SMB_ERROR_TYPE) ? -EIO : -ENXIO; } if (data_bytes == 1) -- cgit v1.2.3