hwmon: Use device_show_string() helper for sysfs attributes
[linux-2.6-block.git] / drivers / hwmon / i5k_amb.c
index ff48913fe6bf62c13a5620e2dac257076e2599bd..02f5d35dd3199091c90208266e7cfb422be718f0 100644 (file)
@@ -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);