diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-21 18:52:57 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-21 18:52:57 -0500 |
commit | 8f1e938db9230d9f828420adea96f691c722e473 (patch) | |
tree | e1d860df714cf9d40e5a4aabd09e364eba2250c0 /arch | |
parent | b3e8d7b2478401b2f25f4566a90faad54f7d6d07 (diff) |
arm: leds: convert sysdev_class to a regular subsystem
After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/leds.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c index 0bcd38341573..1911dae19e4f 100644 --- a/arch/arm/kernel/leds.c +++ b/arch/arm/kernel/leds.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/export.h> | 10 | #include <linux/export.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/sysdev.h> | 12 | #include <linux/device.h> |
13 | #include <linux/syscore_ops.h> | 13 | #include <linux/syscore_ops.h> |
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | 15 | ||
@@ -34,8 +34,8 @@ static const struct leds_evt_name evt_names[] = { | |||
34 | { "red", led_red_on, led_red_off }, | 34 | { "red", led_red_on, led_red_off }, |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static ssize_t leds_store(struct sys_device *dev, | 37 | static ssize_t leds_store(struct device *dev, |
38 | struct sysdev_attribute *attr, | 38 | struct device_attribute *attr, |
39 | const char *buf, size_t size) | 39 | const char *buf, size_t size) |
40 | { | 40 | { |
41 | int ret = -EINVAL, len = strcspn(buf, " "); | 41 | int ret = -EINVAL, len = strcspn(buf, " "); |
@@ -69,15 +69,16 @@ static ssize_t leds_store(struct sys_device *dev, | |||
69 | return ret; | 69 | return ret; |
70 | } | 70 | } |
71 | 71 | ||
72 | static SYSDEV_ATTR(event, 0200, NULL, leds_store); | 72 | static DEVICE_ATTR(event, 0200, NULL, leds_store); |
73 | 73 | ||
74 | static struct sysdev_class leds_sysclass = { | 74 | static struct bus_type leds_subsys = { |
75 | .name = "leds", | 75 | .name = "leds", |
76 | .dev_name = "leds", | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static struct sys_device leds_device = { | 79 | static struct device leds_device = { |
79 | .id = 0, | 80 | .id = 0, |
80 | .cls = &leds_sysclass, | 81 | .bus = &leds_subsys, |
81 | }; | 82 | }; |
82 | 83 | ||
83 | static int leds_suspend(void) | 84 | static int leds_suspend(void) |
@@ -105,11 +106,11 @@ static struct syscore_ops leds_syscore_ops = { | |||
105 | static int __init leds_init(void) | 106 | static int __init leds_init(void) |
106 | { | 107 | { |
107 | int ret; | 108 | int ret; |
108 | ret = sysdev_class_register(&leds_sysclass); | 109 | ret = subsys_system_register(&leds_subsys, NULL); |
109 | if (ret == 0) | 110 | if (ret == 0) |
110 | ret = sysdev_register(&leds_device); | 111 | ret = device_register(&leds_device); |
111 | if (ret == 0) | 112 | if (ret == 0) |
112 | ret = sysdev_create_file(&leds_device, &attr_event); | 113 | ret = device_create_file(&leds_device, &dev_attr_event); |
113 | if (ret == 0) | 114 | if (ret == 0) |
114 | register_syscore_ops(&leds_syscore_ops); | 115 | register_syscore_ops(&leds_syscore_ops); |
115 | return ret; | 116 | return ret; |