diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2010-06-20 03:22:31 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-06-20 03:22:31 -0400 |
commit | 0e6c7870856c7fb4ee054d28ac253b2d3d0c7e36 (patch) | |
tree | 2714660805f9ff6e7781c354ba3c4c6ee9cdb757 | |
parent | eefc2d9e3d4f8820f2c128a0e44a23de28b1ed64 (diff) |
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: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org [2.6.34 only]
-rw-r--r-- | drivers/hwmon/i5k_amb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index e880e2c3871d..937983407e2a 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c | |||
@@ -289,6 +289,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
289 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; | 289 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; |
290 | iattr->s_attr.dev_attr.show = show_label; | 290 | iattr->s_attr.dev_attr.show = show_label; |
291 | iattr->s_attr.index = k; | 291 | iattr->s_attr.index = k; |
292 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
292 | res = device_create_file(&pdev->dev, | 293 | res = device_create_file(&pdev->dev, |
293 | &iattr->s_attr.dev_attr); | 294 | &iattr->s_attr.dev_attr); |
294 | if (res) | 295 | if (res) |
@@ -303,6 +304,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
303 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; | 304 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; |
304 | iattr->s_attr.dev_attr.show = show_amb_temp; | 305 | iattr->s_attr.dev_attr.show = show_amb_temp; |
305 | iattr->s_attr.index = k; | 306 | iattr->s_attr.index = k; |
307 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
306 | res = device_create_file(&pdev->dev, | 308 | res = device_create_file(&pdev->dev, |
307 | &iattr->s_attr.dev_attr); | 309 | &iattr->s_attr.dev_attr); |
308 | if (res) | 310 | if (res) |
@@ -318,6 +320,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
318 | iattr->s_attr.dev_attr.show = show_amb_min; | 320 | iattr->s_attr.dev_attr.show = show_amb_min; |
319 | iattr->s_attr.dev_attr.store = store_amb_min; | 321 | iattr->s_attr.dev_attr.store = store_amb_min; |
320 | iattr->s_attr.index = k; | 322 | iattr->s_attr.index = k; |
323 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
321 | res = device_create_file(&pdev->dev, | 324 | res = device_create_file(&pdev->dev, |
322 | &iattr->s_attr.dev_attr); | 325 | &iattr->s_attr.dev_attr); |
323 | if (res) | 326 | if (res) |
@@ -333,6 +336,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
333 | iattr->s_attr.dev_attr.show = show_amb_mid; | 336 | iattr->s_attr.dev_attr.show = show_amb_mid; |
334 | iattr->s_attr.dev_attr.store = store_amb_mid; | 337 | iattr->s_attr.dev_attr.store = store_amb_mid; |
335 | iattr->s_attr.index = k; | 338 | iattr->s_attr.index = k; |
339 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
336 | res = device_create_file(&pdev->dev, | 340 | res = device_create_file(&pdev->dev, |
337 | &iattr->s_attr.dev_attr); | 341 | &iattr->s_attr.dev_attr); |
338 | if (res) | 342 | if (res) |
@@ -348,6 +352,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
348 | iattr->s_attr.dev_attr.show = show_amb_max; | 352 | iattr->s_attr.dev_attr.show = show_amb_max; |
349 | iattr->s_attr.dev_attr.store = store_amb_max; | 353 | iattr->s_attr.dev_attr.store = store_amb_max; |
350 | iattr->s_attr.index = k; | 354 | iattr->s_attr.index = k; |
355 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
351 | res = device_create_file(&pdev->dev, | 356 | res = device_create_file(&pdev->dev, |
352 | &iattr->s_attr.dev_attr); | 357 | &iattr->s_attr.dev_attr); |
353 | if (res) | 358 | if (res) |
@@ -362,6 +367,7 @@ static int __devinit i5k_amb_hwmon_init(struct platform_device *pdev) | |||
362 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; | 367 | iattr->s_attr.dev_attr.attr.mode = S_IRUGO; |
363 | iattr->s_attr.dev_attr.show = show_amb_alarm; | 368 | iattr->s_attr.dev_attr.show = show_amb_alarm; |
364 | iattr->s_attr.index = k; | 369 | iattr->s_attr.index = k; |
370 | sysfs_attr_init(&iattr->s_attr.dev_attr.attr); | ||
365 | res = device_create_file(&pdev->dev, | 371 | res = device_create_file(&pdev->dev, |
366 | &iattr->s_attr.dev_attr); | 372 | &iattr->s_attr.dev_attr); |
367 | if (res) | 373 | if (res) |