Commit fa74419b authored by Nicolas Boichat's avatar Nicolas Boichat Committed by Linus Torvalds

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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ae2d990e
...@@ -491,6 +491,12 @@ static void applesmc_idev_poll(unsigned long unused) ...@@ -491,6 +491,12 @@ static void applesmc_idev_poll(unsigned long unused)
/* Sysfs Files */ /* Sysfs Files */
static ssize_t applesmc_name_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return snprintf(buf, PAGE_SIZE, "applesmc\n");
}
static ssize_t applesmc_position_show(struct device *dev, static ssize_t applesmc_position_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
...@@ -913,6 +919,8 @@ static struct led_classdev applesmc_backlight = { ...@@ -913,6 +919,8 @@ static struct led_classdev applesmc_backlight = {
.brightness_set = applesmc_brightness_set, .brightness_set = applesmc_brightness_set,
}; };
static DEVICE_ATTR(name, 0444, applesmc_name_show, NULL);
static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL);
static DEVICE_ATTR(calibrate, 0644, static DEVICE_ATTR(calibrate, 0644,
applesmc_calibrate_show, applesmc_calibrate_store); applesmc_calibrate_show, applesmc_calibrate_store);
...@@ -1197,6 +1205,8 @@ static int __init applesmc_init(void) ...@@ -1197,6 +1205,8 @@ static int __init applesmc_init(void)
goto out_driver; goto out_driver;
} }
ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_name.attr);
/* Create key enumeration sysfs files */ /* Create key enumeration sysfs files */
ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group); ret = sysfs_create_group(&pdev->dev.kobj, &key_enumeration_group);
if (ret) if (ret)
......
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