diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-02-17 13:21:26 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-03-03 11:01:06 -0500 |
commit | c1ea0a0431bc63a24bc0a887c94e93c1ecafd668 (patch) | |
tree | dbdf02d2bee946f7da708607380f57251a749582 /drivers/hwmon | |
parent | 71ba0f315cc024e3467a49ee63f0b4b4019cdb46 (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.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index 066e587a18a5..52646bba748b 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c | |||
@@ -545,11 +545,11 @@ static int max6639_detect(struct i2c_client *client, | |||
545 | static int max6639_probe(struct i2c_client *client, | 545 | static int max6639_probe(struct i2c_client *client, |
546 | const struct i2c_device_id *id) | 546 | const struct i2c_device_id *id) |
547 | { | 547 | { |
548 | struct device *dev = &client->dev; | ||
548 | struct max6639_data *data; | 549 | struct max6639_data *data; |
549 | int err; | 550 | int err; |
550 | 551 | ||
551 | data = devm_kzalloc(&client->dev, sizeof(struct max6639_data), | 552 | data = devm_kzalloc(dev, sizeof(struct max6639_data), GFP_KERNEL); |
552 | GFP_KERNEL); | ||
553 | if (!data) | 553 | if (!data) |
554 | return -ENOMEM; | 554 | return -ENOMEM; |
555 | 555 | ||
@@ -562,22 +562,20 @@ static int max6639_probe(struct i2c_client *client, | |||
562 | return err; | 562 | return err; |
563 | 563 | ||
564 | /* Register sysfs hooks */ | 564 | /* Register sysfs hooks */ |
565 | err = sysfs_create_group(&client->dev.kobj, &max6639_group); | 565 | err = sysfs_create_group(&dev->kobj, &max6639_group); |
566 | if (err) | 566 | if (err) |
567 | return err; | 567 | return err; |
568 | 568 | ||
569 | data->hwmon_dev = hwmon_device_register(&client->dev); | 569 | data->hwmon_dev = hwmon_device_register(dev); |
570 | if (IS_ERR(data->hwmon_dev)) { | 570 | if (IS_ERR(data->hwmon_dev)) { |
571 | err = PTR_ERR(data->hwmon_dev); | 571 | err = PTR_ERR(data->hwmon_dev); |
572 | goto error_remove; | 572 | goto error_remove; |
573 | } | 573 | } |
574 | 574 | ||
575 | dev_info(&client->dev, "temperature sensor and fan control found\n"); | ||
576 | |||
577 | return 0; | 575 | return 0; |
578 | 576 | ||
579 | error_remove: | 577 | error_remove: |
580 | sysfs_remove_group(&client->dev.kobj, &max6639_group); | 578 | sysfs_remove_group(&dev->kobj, &max6639_group); |
581 | return err; | 579 | return err; |
582 | } | 580 | } |
583 | 581 | ||