aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/ltc4245.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index d4172933ce4f..2c6da5d955f5 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -512,24 +512,10 @@ static int ltc4245_probe(struct i2c_client *client,
512 /* Add sysfs hooks */ 512 /* Add sysfs hooks */
513 ltc4245_sysfs_add_groups(data); 513 ltc4245_sysfs_add_groups(data);
514 514
515 hwmon_dev = hwmon_device_register_with_groups(&client->dev, 515 hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev,
516 client->name, data, 516 client->name, data,
517 data->groups); 517 data->groups);
518 if (IS_ERR(hwmon_dev)) 518 return PTR_ERR_OR_ZERO(hwmon_dev);
519 return PTR_ERR(hwmon_dev);
520
521 i2c_set_clientdata(client, hwmon_dev);
522
523 return 0;
524}
525
526static int ltc4245_remove(struct i2c_client *client)
527{
528 struct device *hwmon_dev = i2c_get_clientdata(client);
529
530 hwmon_device_unregister(hwmon_dev);
531
532 return 0;
533} 519}
534 520
535static const struct i2c_device_id ltc4245_id[] = { 521static const struct i2c_device_id ltc4245_id[] = {
@@ -544,7 +530,6 @@ static struct i2c_driver ltc4245_driver = {
544 .name = "ltc4245", 530 .name = "ltc4245",
545 }, 531 },
546 .probe = ltc4245_probe, 532 .probe = ltc4245_probe,
547 .remove = ltc4245_remove,
548 .id_table = ltc4245_id, 533 .id_table = ltc4245_id,
549}; 534};
550 535