diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-04-13 09:50:21 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-04-13 09:50:21 +0200 |
commit | 659c36fcda403013a01b85da07cf2d9711e6d6c7 (patch) | |
tree | ece2e7d0e2c19ea5a3d0ec172ad0b81a8a19021d /drivers/hwmon/lm83.c | |
parent | 9521d830b6341d1887dcfc2aebde23fbfa5f1473 (diff) | |
parent | 5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Fixes and improvements for perf/core:
. Overhaul the tools/ makefiles, gluing them to the top level Makefile, from
Borislav Petkov.
. Move the UI files from tools/perf/util/ui/ to tools/perf/ui/. Also move
the GTK+ browser to tools/perf/ui/gtk/, from Namhyung Kim.
. Only fallback to sw cycles counter on ENOENT for the hw cycles, from
Robert Richter
. Trivial fixes from Robert Richter
. Handle the autogenerated bison/flex files better, from Namhyung and Jiri Olsa.
. Navigate jump instructions in the annotate browser, just press enter or ->,
still needs support for a jump navigation history, i.e. to go back.
. Search string in the annotate browser: same keys as vim:
/ forward
n next backward/forward
? backward
. Clarify number of events/samples in the report header, from Ashay Rane
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/hwmon/lm83.c')
-rw-r--r-- | drivers/hwmon/lm83.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/hwmon/lm83.c b/drivers/hwmon/lm83.c index 8290476aee4..cd45b9d8558 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); /* * Driver data (common to all clients) */ - + static const struct i2c_device_id lm83_id[] = { { "lm83", lm83 }, { "lm82", lm82 }, @@ -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 i2c_client *client = to_i2c_client(dev); struct lm83_data *data = i2c_get_clientdata(client); - long val = simple_strtol(buf, NULL, 10); + long val; int nr = attr->index; + int err; + + err = kstrtol(buf, 10, &val); + if (err < 0) + return err; mutex_lock(&data->update_lock); data->temp[nr] = TEMP_TO_REG(val); @@ -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. */ - 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; if (id->driver_data == lm83) { - if ((err = sysfs_create_group(&new_client->dev.kobj, - &lm83_group_opt))) + err = sysfs_create_group(&new_client->dev.kobj, + &lm83_group_opt); + if (err) goto exit_remove_files; } @@ -423,19 +430,8 @@ static struct lm83_data *lm83_update_device(struct device *dev) return data; } -static int __init sensors_lm83_init(void) -{ - return i2c_add_driver(&lm83_driver); -} - -static void __exit sensors_lm83_exit(void) -{ - i2c_del_driver(&lm83_driver); -} +module_i2c_driver(lm83_driver); MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); MODULE_DESCRIPTION("LM83 driver"); MODULE_LICENSE("GPL"); - -module_init(sensors_lm83_init); -module_exit(sensors_lm83_exit); |