aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/lm90.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 701e952ae523..733b42e8b2d1 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -1057,6 +1057,15 @@ static const struct attribute_group lm90_group = {
1057 .attrs = lm90_attributes, 1057 .attrs = lm90_attributes,
1058}; 1058};
1059 1059
1060static struct attribute *lm90_temp2_offset_attributes[] = {
1061 &sensor_dev_attr_temp2_offset.dev_attr.attr,
1062 NULL
1063};
1064
1065static const struct attribute_group lm90_temp2_offset_group = {
1066 .attrs = lm90_temp2_offset_attributes,
1067};
1068
1060/* 1069/*
1061 * Additional attributes for devices with emergency sensors 1070 * Additional attributes for devices with emergency sensors
1062 */ 1071 */
@@ -1404,7 +1413,7 @@ static void lm90_remove_files(struct i2c_client *client, struct lm90_data *data)
1404 if (data->flags & LM90_HAVE_EMERGENCY) 1413 if (data->flags & LM90_HAVE_EMERGENCY)
1405 sysfs_remove_group(&dev->kobj, &lm90_emergency_group); 1414 sysfs_remove_group(&dev->kobj, &lm90_emergency_group);
1406 if (data->flags & LM90_HAVE_OFFSET) 1415 if (data->flags & LM90_HAVE_OFFSET)
1407 device_remove_file(dev, &sensor_dev_attr_temp2_offset.dev_attr); 1416 sysfs_remove_group(&dev->kobj, &lm90_temp2_offset_group);
1408 device_remove_file(dev, &dev_attr_pec); 1417 device_remove_file(dev, &dev_attr_pec);
1409 sysfs_remove_group(&dev->kobj, &lm90_group); 1418 sysfs_remove_group(&dev->kobj, &lm90_group);
1410} 1419}
@@ -1574,8 +1583,7 @@ static int lm90_probe(struct i2c_client *client,
1574 goto exit_remove_files; 1583 goto exit_remove_files;
1575 } 1584 }
1576 if (data->flags & LM90_HAVE_OFFSET) { 1585 if (data->flags & LM90_HAVE_OFFSET) {
1577 err = device_create_file(dev, 1586 err = sysfs_create_group(&dev->kobj, &lm90_temp2_offset_group);
1578 &sensor_dev_attr_temp2_offset.dev_attr);
1579 if (err) 1587 if (err)
1580 goto exit_remove_files; 1588 goto exit_remove_files;
1581 } 1589 }