diff options
author | Frans Meulenbroeks <fransmeulenbroeks@gmail.com> | 2012-01-10 17:01:40 -0500 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-18 21:26:43 -0400 |
commit | b3789a0de229b4e9cc6d2531c7cbcdb5424a37b8 (patch) | |
tree | bf3a9a2e20186cbbf9ea5c412cd8669a7e0cc372 /drivers/hwmon/lm83.c | |
parent | 93092a644fb519ec520c3a1f3e05ef9d25b1dac4 (diff) |
hwmon: (lm83) fix checkpatch issues
resolved:
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line
WARNING: simple_strtol is obsolete, use kstrtol instead
ERROR: do not use assignment in if condition
Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/lm83.c')
-rw-r--r-- | drivers/hwmon/lm83.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c index 8290476aee4a..1fed26579fdb 100644 --- a/drivers/hwmon/lm83.c +++ b/drivers/hwmon/lm83.c | |||
@@ -124,7 +124,7 @@ static struct lm83_data *lm83_update_device(struct device *dev); | |||
124 | /* | 124 | /* |
125 | * Driver data (common to all clients) | 125 | * Driver data (common to all clients) |
126 | */ | 126 | */ |
127 | 127 | ||
128 | static const struct i2c_device_id lm83_id[] = { | 128 | static const struct i2c_device_id lm83_id[] = { |
129 | { "lm83", lm83 }, | 129 | { "lm83", lm83 }, |
130 | { "lm82", lm82 }, | 130 | { "lm82", lm82 }, |
@@ -179,8 +179,13 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr, | |||
179 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 179 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
180 | struct i2c_client *client = to_i2c_client(dev); | 180 | struct i2c_client *client = to_i2c_client(dev); |
181 | struct lm83_data *data = i2c_get_clientdata(client); | 181 | struct lm83_data *data = i2c_get_clientdata(client); |
182 | long val = simple_strtol(buf, NULL, 10); | 182 | long val; |
183 | int nr = attr->index; | 183 | int nr = attr->index; |
184 | int err; | ||
185 | |||
186 | err = kstrtol(buf, 10, &val); | ||
187 | if (err < 0) | ||
188 | return err; | ||
184 | 189 | ||
185 | mutex_lock(&data->update_lock); | 190 | mutex_lock(&data->update_lock); |
186 | data->temp[nr] = TEMP_TO_REG(val); | 191 | data->temp[nr] = TEMP_TO_REG(val); |
@@ -355,12 +360,14 @@ static int lm83_probe(struct i2c_client *new_client, | |||
355 | * declare 1 and 3 common, and then 2 and 4 only for the LM83. | 360 | * declare 1 and 3 common, and then 2 and 4 only for the LM83. |
356 | */ | 361 | */ |
357 | 362 | ||
358 | if ((err = sysfs_create_group(&new_client->dev.kobj, &lm83_group))) | 363 | err = sysfs_create_group(&new_client->dev.kobj, &lm83_group); |
364 | if (err) | ||
359 | goto exit_free; | 365 | goto exit_free; |
360 | 366 | ||
361 | if (id->driver_data == lm83) { | 367 | if (id->driver_data == lm83) { |
362 | if ((err = sysfs_create_group(&new_client->dev.kobj, | 368 | err = sysfs_create_group(&new_client->dev.kobj, |
363 | &lm83_group_opt))) | 369 | &lm83_group_opt); |
370 | if (err) | ||
364 | goto exit_remove_files; | 371 | goto exit_remove_files; |
365 | } | 372 | } |
366 | 373 | ||