diff options
author | Frans Meulenbroeks <fransmeulenbroeks@gmail.com> | 2012-01-08 13:34:18 -0500 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-18 21:26:31 -0400 |
commit | 08f509077499907c8bae59818771ce18d3179aa9 (patch) | |
tree | 2c7855e24158a1860ab66ae09a92a1a3a4bebd53 | |
parent | 4d7c5d4f40246f0f50767a1fe6445e067a972c64 (diff) |
hwmon: (adm1029) fix checkpatch issues
fixed:
ERROR: space prohibited after that open parenthesis '('
+#define DIV_FROM_REG(val) ( 1 << (((val) >> 6) - 1))
WARNING: simple_strtol is obsolete, use kstrtol instead
+ long val = simple_strtol(buf, NULL, 10);
ERROR: do not use assignment in if condition
+ if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group)))
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
-rw-r--r-- | drivers/hwmon/adm1029.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c index 0b8a3b145bd2..d789c334476b 100644 --- a/drivers/hwmon/adm1029.c +++ b/drivers/hwmon/adm1029.c | |||
@@ -78,7 +78,7 @@ static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, | |||
78 | 78 | ||
79 | #define TEMP_FROM_REG(val) ((val) * 1000) | 79 | #define TEMP_FROM_REG(val) ((val) * 1000) |
80 | 80 | ||
81 | #define DIV_FROM_REG(val) ( 1 << (((val) >> 6) - 1)) | 81 | #define DIV_FROM_REG(val) (1 << (((val) >> 6) - 1)) |
82 | 82 | ||
83 | /* Registers to be checked by adm1029_update_device() */ | 83 | /* Registers to be checked by adm1029_update_device() */ |
84 | static const u8 ADM1029_REG_TEMP[] = { | 84 | static const u8 ADM1029_REG_TEMP[] = { |
@@ -200,8 +200,11 @@ static ssize_t set_fan_div(struct device *dev, | |||
200 | struct i2c_client *client = to_i2c_client(dev); | 200 | struct i2c_client *client = to_i2c_client(dev); |
201 | struct adm1029_data *data = i2c_get_clientdata(client); | 201 | struct adm1029_data *data = i2c_get_clientdata(client); |
202 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 202 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
203 | long val = simple_strtol(buf, NULL, 10); | ||
204 | u8 reg; | 203 | u8 reg; |
204 | long val; | ||
205 | int ret = kstrtol(buf, 10, &val); | ||
206 | if (ret < 0) | ||
207 | return ret; | ||
205 | 208 | ||
206 | mutex_lock(&data->update_lock); | 209 | mutex_lock(&data->update_lock); |
207 | 210 | ||
@@ -355,7 +358,8 @@ static int adm1029_probe(struct i2c_client *client, | |||
355 | } | 358 | } |
356 | 359 | ||
357 | /* Register sysfs hooks */ | 360 | /* Register sysfs hooks */ |
358 | if ((err = sysfs_create_group(&client->dev.kobj, &adm1029_group))) | 361 | err = sysfs_create_group(&client->dev.kobj, &adm1029_group); |
362 | if (err) | ||
359 | goto exit_free; | 363 | goto exit_free; |
360 | 364 | ||
361 | data->hwmon_dev = hwmon_device_register(&client->dev); | 365 | data->hwmon_dev = hwmon_device_register(&client->dev); |