summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/i5k_amb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/i5k_amb.c')
-rw-r--r--drivers/hwmon/i5k_amb.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
index ff48913fe6..02f5d35dd3 100644
--- a/drivers/hwmon/i5k_amb.c
+++ b/drivers/hwmon/i5k_amb.c
@@ -101,14 +101,7 @@ struct i5k_amb_data {
unsigned int num_attrs;
};
-static ssize_t name_show(struct device *dev, struct device_attribute *devattr,
- char *buf)
-{
- return sprintf(buf, "%s\n", DRVNAME);
-}
-
-
-static DEVICE_ATTR_RO(name);
+static DEVICE_STRING_ATTR_RO(name, 0444, DRVNAME);
static struct platform_device *amb_pdev;
@@ -373,7 +366,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
}
}
- res = device_create_file(&pdev->dev, &dev_attr_name);
+ res = device_create_file(&pdev->dev, &dev_attr_name.attr);
if (res)
goto exit_remove;
@@ -386,7 +379,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev)
return res;
exit_remove:
- device_remove_file(&pdev->dev, &dev_attr_name);
+ device_remove_file(&pdev->dev, &dev_attr_name.attr);
for (i = 0; i < data->num_attrs; i++)
device_remove_file(&pdev->dev, &data->attrs[i].s_attr.dev_attr);
kfree(data->attrs);
@@ -561,7 +554,7 @@ static void i5k_amb_remove(struct platform_device *pdev)
struct i5k_amb_data *data = platform_get_drvdata(pdev);
hwmon_device_unregister(data->hwmon_dev);
- device_remove_file(&pdev->dev, &dev_attr_name);
+ device_remove_file(&pdev->dev, &dev_attr_name.attr);
for (i = 0; i < data->num_attrs; i++)
device_remove_file(&pdev->dev, &data->attrs[i].s_attr.dev_attr);
kfree(data->attrs);