Commit b3789a0d authored by Frans Meulenbroeks's avatar Frans Meulenbroeks Committed by Guenter Roeck

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: default avatarFrans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
parent 93092a64
...@@ -124,7 +124,7 @@ static struct lm83_data *lm83_update_device(struct device *dev); ...@@ -124,7 +124,7 @@ static struct lm83_data *lm83_update_device(struct device *dev);
/* /*
* Driver data (common to all clients) * Driver data (common to all clients)
*/ */
static const struct i2c_device_id lm83_id[] = { static const struct i2c_device_id lm83_id[] = {
{ "lm83", lm83 }, { "lm83", lm83 },
{ "lm82", lm82 }, { "lm82", lm82 },
...@@ -179,8 +179,13 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr, ...@@ -179,8 +179,13 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
struct lm83_data *data = i2c_get_clientdata(client); struct lm83_data *data = i2c_get_clientdata(client);
long val = simple_strtol(buf, NULL, 10); long val;
int nr = attr->index; int nr = attr->index;
int err;
err = kstrtol(buf, 10, &val);
if (err < 0)
return err;
mutex_lock(&data->update_lock); mutex_lock(&data->update_lock);
data->temp[nr] = TEMP_TO_REG(val); data->temp[nr] = TEMP_TO_REG(val);
...@@ -355,12 +360,14 @@ static int lm83_probe(struct i2c_client *new_client, ...@@ -355,12 +360,14 @@ static int lm83_probe(struct i2c_client *new_client,
* declare 1 and 3 common, and then 2 and 4 only for the LM83. * declare 1 and 3 common, and then 2 and 4 only for the LM83.
*/ */
if ((err = sysfs_create_group(&new_client->dev.kobj, &lm83_group))) err = sysfs_create_group(&new_client->dev.kobj, &lm83_group);
if (err)
goto exit_free; goto exit_free;
if (id->driver_data == lm83) { if (id->driver_data == lm83) {
if ((err = sysfs_create_group(&new_client->dev.kobj, err = sysfs_create_group(&new_client->dev.kobj,
&lm83_group_opt))) &lm83_group_opt);
if (err)
goto exit_remove_files; goto exit_remove_files;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment