diff options
author | Nicolas Boichat <nicolas@boichat.ch> | 2007-05-23 16:58:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-23 23:14:15 -0400 |
commit | fa74419bb7b51af4bbb66116d14cc92f0b5aff25 (patch) | |
tree | 0a815937d540672909965e7e61cf64dbac339f9d /drivers/hwmon/applesmc.c | |
parent | ae2d990eede0ef5938c210d48a177c044258ecd8 (diff) |
applesmc - sensors patch missing from 2.6.22-rc2
Add name file needed by lm_sensors user-space applications in applesmc
sysfs tree.
Cc: Soeren Sonnenburg <kernel@nn7.de>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/applesmc.c')
-rw-r--r-- | drivers/hwmon/applesmc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 0c160675b3a..366f4a1a2cb 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -491,6 +491,12 @@ out: | |||
491 | 491 | ||
492 | /* Sysfs Files */ | 492 | /* Sysfs Files */ |
493 | 493 | ||
494 | static ssize_t applesmc_name_show(struct device *dev, | ||
495 | struct device_attribute *attr, char *buf) | ||
496 | { | ||
497 | return snprintf(buf, PAGE_SIZE, "applesmc\n"); | ||
498 | } | ||
499 | |||
494 | static ssize_t applesmc_position_show(struct device *dev, | 500 | static ssize_t applesmc_position_show(struct device *dev, |
495 | struct device_attribute *attr, char *buf) | 501 | struct device_attribute *attr, char *buf) |
496 | { | 502 | { |
@@ -913,6 +919,8 @@ static struct led_classdev applesmc_backlight = { | |||
913 | .brightness_set = applesmc_brightness_set, | 919 | .brightness_set = applesmc_brightness_set, |
914 | }; | 920 | }; |
915 | 921 | ||
922 | static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL); | ||
923 | |||
916 | static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); | 924 | static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); |
917 | static DEVICE_ATTR(calibrate, 0644, | 925 | static DEVICE_ATTR(calibrate, 0644, |
918 | applesmc_calibrate_show, applesmc_calibrate_store); | 926 | applesmc_calibrate_show, applesmc_calibrate_store); |
@@ -1197,6 +1205,8 @@ static int __init applesmc_init(void) | |||
1197 | goto out_driver; | 1205 | goto out_driver; |
1198 | } | 1206 | } |
1199 | 1207 | ||
1208 | ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr); | ||
1209 | |||
1200 | /* Create key enumeration sysfs files */ | 1210 | /* Create key enumeration sysfs files */ |
1201 | ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); | 1211 | ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); |
1202 | if (ret) | 1212 | if (ret) |