summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-02-17 10:21:26 -0800
committerGuenter Roeck <linux@roeck-us.net>2014-03-03 08:01:06 -0800
commitc1ea0a0431bc63a24bc0a887c94e93c1ecafd668 (patch)
treedbdf02d2bee946f7da708607380f57251a749582 /drivers/hwmon
parent71ba0f315cc024e3467a49ee63f0b4b4019cdb46 (diff)
hwmon: (max6639) Introduce local dev variable, and reduce noisiness
Introduce local variable 'dev' in probe function to make code easier to read. Also drop dev_info message in probe to reduce noisiness during boot. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/max6639.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
index 066e587a18a..52646bba748 100644
--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -545,11 +545,11 @@ static int max6639_detect(struct i2c_client *client,
static int max6639_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
+ struct device *dev = &client->dev;
struct max6639_data *data;
int err;
- data = devm_kzalloc(&client->dev, sizeof(struct max6639_data),
- GFP_KERNEL);
+ data = devm_kzalloc(dev, sizeof(struct max6639_data), GFP_KERNEL);
if (!data)
return -ENOMEM;
@@ -562,22 +562,20 @@ static int max6639_probe(struct i2c_client *client,
return err;
/* Register sysfs hooks */
- err = sysfs_create_group(&client->dev.kobj, &max6639_group);
+ err = sysfs_create_group(&dev->kobj, &max6639_group);
if (err)
return err;
- data->hwmon_dev = hwmon_device_register(&client->dev);
+ data->hwmon_dev = hwmon_device_register(dev);
if (IS_ERR(data->hwmon_dev)) {
err = PTR_ERR(data->hwmon_dev);
goto error_remove;
}
- dev_info(&client->dev, "temperature sensor and fan control found\n");
-
return 0;
error_remove:
- sysfs_remove_group(&client->dev.kobj, &max6639_group);
+ sysfs_remove_group(&dev->kobj, &max6639_group);
return err;
}