]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
hwmon: (i5k_amb) Fix sysfs attribute for lockdep
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Sun, 20 Jun 2010 07:22:31 +0000 (09:22 +0200)
committerJean Delvare <khali@linux-fr.org>
Sun, 20 Jun 2010 07:22:31 +0000 (09:22 +0200)
i5k_amb.ko uses dynamically allocated memory (by kmalloc) for
attributes passed to sysfs. So, sysfs_attr_init() should be called
for working happy with lockdep.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org [2.6.34 only]
drivers/hwmon/i5k_amb.c

index e880e2c3871d0e2098913c7b130c3a35de7e4f65..937983407e2a47b12569d9ca4305af174e78f405 100644 (file)
@@ -289,6 +289,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_label;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -303,6 +304,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_amb_temp;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -318,6 +320,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_min;
                        iattr->s_attr.dev_attr.store = store_amb_min;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -333,6 +336,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_mid;
                        iattr->s_attr.dev_attr.store = store_amb_mid;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -348,6 +352,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.show = show_amb_max;
                        iattr->s_attr.dev_attr.store = store_amb_max;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)
@@ -362,6 +367,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev)
                        iattr->s_attr.dev_attr.attr.mode = S_IRUGO;
                        iattr->s_attr.dev_attr.show = show_amb_alarm;
                        iattr->s_attr.index = k;
+                       sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
                        res = device_create_file(&pdev->dev,
                                                 &iattr->s_attr.dev_attr);
                        if (res)