Commit 0e6c7870 authored by KAMEZAWA Hiroyuki's avatar KAMEZAWA Hiroyuki Committed by Jean Delvare

hwmon: (i5k_amb) Fix sysfs attribute for lockdep

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: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org [2.6.34 only]
parent eefc2d9e
...@@ -289,6 +289,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.attr.mode = S_IRUGO;
iattr->s_attr.dev_attr.show = show_label; iattr->s_attr.dev_attr.show = show_label;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
...@@ -303,6 +304,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.attr.mode = S_IRUGO;
iattr->s_attr.dev_attr.show = show_amb_temp; iattr->s_attr.dev_attr.show = show_amb_temp;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
...@@ -318,6 +320,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.show = show_amb_min;
iattr->s_attr.dev_attr.store = store_amb_min; iattr->s_attr.dev_attr.store = store_amb_min;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
...@@ -333,6 +336,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.show = show_amb_mid;
iattr->s_attr.dev_attr.store = store_amb_mid; iattr->s_attr.dev_attr.store = store_amb_mid;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
...@@ -348,6 +352,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.show = show_amb_max;
iattr->s_attr.dev_attr.store = store_amb_max; iattr->s_attr.dev_attr.store = store_amb_max;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
...@@ -362,6 +367,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) ...@@ -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.attr.mode = S_IRUGO;
iattr->s_attr.dev_attr.show = show_amb_alarm; iattr->s_attr.dev_attr.show = show_amb_alarm;
iattr->s_attr.index = k; iattr->s_attr.index = k;
sysfs_attr_init(&iattr->s_attr.dev_attr.attr);
res = device_create_file(&pdev->dev, res = device_create_file(&pdev->dev,
&iattr->s_attr.dev_attr); &iattr->s_attr.dev_attr);
if (res) if (res)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment