X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fthmc50.c;h=76a3859c3fbeadd95b8a7af0c1b2c40e4cc7f860;hb=4934ed888e6fe78d9d339471fb870819da911e8b;hp=fb02834897f39c6ab06f6dbce53f7ad182290df0;hpb=894c00cf3805670faddd41d3d5dcb3c0ab75a39d;p=karo-tx-linux.git diff --git a/drivers/hwmon/thmc50.c b/drivers/hwmon/thmc50.c index fb02834897f3..76a3859c3fbe 100644 --- a/drivers/hwmon/thmc50.c +++ b/drivers/hwmon/thmc50.c @@ -32,7 +32,7 @@ MODULE_LICENSE("GPL"); /* Addresses to scan */ -static unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; +static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END }; /* Insmod parameters */ I2C_CLIENT_INSMOD_2(thmc50, adm1022); @@ -52,9 +52,9 @@ I2C_CLIENT_MODULE_PARM(adm1022_temp3, "List of adapter,address pairs " */ #define THMC50_REG_INTR 0x41 -const static u8 THMC50_REG_TEMP[] = { 0x27, 0x26, 0x20 }; -const static u8 THMC50_REG_TEMP_MIN[] = { 0x3A, 0x38, 0x2C }; -const static u8 THMC50_REG_TEMP_MAX[] = { 0x39, 0x37, 0x2B }; +static const u8 THMC50_REG_TEMP[] = { 0x27, 0x26, 0x20 }; +static const u8 THMC50_REG_TEMP_MIN[] = { 0x3A, 0x38, 0x2C }; +static const u8 THMC50_REG_TEMP_MAX[] = { 0x39, 0x37, 0x2B }; #define THMC50_REG_CONF_nFANOFF 0x20 @@ -259,7 +259,7 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind) struct thmc50_data *data; struct device *dev; int err = 0; - const char *type_name = ""; + const char *type_name; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { pr_debug("thmc50: detect failed, " @@ -309,13 +309,9 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind) pr_debug("thmc50: Detection of THMC50/ADM1022 failed\n"); goto exit_free; } - pr_debug("thmc50: Detected %s (version %x, revision %x)\n", - type_name, (revision >> 4) - 0xc, revision & 0xf); data->type = kind; - if (kind == thmc50) - type_name = "thmc50"; - else if (kind == adm1022) { + if (kind == adm1022) { int id = i2c_adapter_id(client->adapter); int i; @@ -328,7 +324,11 @@ static int thmc50_detect(struct i2c_adapter *adapter, int address, int kind) data->has_temp3 = 1; break; } + } else { + type_name = "thmc50"; } + pr_debug("thmc50: Detected %s (version %x, revision %x)\n", + type_name, (revision >> 4) - 0xc, revision & 0xf); /* Fill in the remaining client fields & put it into the global list */ strlcpy(client->name, type_name, I2C_NAME_SIZE);