Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280086
b: refs/heads/master
c: 8f1e938
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Dec 21, 2011
1 parent 2846345 commit b364c00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3e8d7b2478401b2f25f4566a90faad54f7d6d07
refs/heads/master: 8f1e938db9230d9f828420adea96f691c722e473
21 changes: 11 additions & 10 deletions trunk/arch/arm/kernel/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
#include <linux/export.h>
#include <linux/init.h>
#include <linux/sysdev.h>
#include <linux/device.h>
#include <linux/syscore_ops.h>
#include <linux/string.h>

Expand All @@ -34,8 +34,8 @@ static const struct leds_evt_name evt_names[] = {
{ "red", led_red_on, led_red_off },
};

static ssize_t leds_store(struct sys_device *dev,
struct sysdev_attribute *attr,
static ssize_t leds_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
int ret = -EINVAL, len = strcspn(buf, " ");
Expand Down Expand Up @@ -69,15 +69,16 @@ static ssize_t leds_store(struct sys_device *dev,
return ret;
}

static SYSDEV_ATTR(event, 0200, NULL, leds_store);
static DEVICE_ATTR(event, 0200, NULL, leds_store);

static struct sysdev_class leds_sysclass = {
static struct bus_type leds_subsys = {
.name = "leds",
.dev_name = "leds",
};

static struct sys_device leds_device = {
static struct device leds_device = {
.id = 0,
.cls = &leds_sysclass,
.bus = &leds_subsys,
};

static int leds_suspend(void)
Expand Down Expand Up @@ -105,11 +106,11 @@ static struct syscore_ops leds_syscore_ops = {
static int __init leds_init(void)
{
int ret;
ret = sysdev_class_register(&leds_sysclass);
ret = subsys_system_register(&leds_subsys, NULL);
if (ret == 0)
ret = sysdev_register(&leds_device);
ret = device_register(&leds_device);
if (ret == 0)
ret = sysdev_create_file(&leds_device, &attr_event);
ret = device_create_file(&leds_device, &dev_attr_event);
if (ret == 0)
register_syscore_ops(&leds_syscore_ops);
return ret;
Expand Down

0 comments on commit b364c00

Please sign in to comment.