Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280082
b: refs/heads/master
c: 0e38eaf
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Dec 21, 2011
1 parent 6559d84 commit 3ba3ff7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 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: dc6876a288cc6a446a6617ccfcb96082f67fa0c4
refs/heads/master: 0e38eaf34e0d9955aeaaed9648b2cfaba3076fee
44 changes: 22 additions & 22 deletions trunk/arch/mips/txx9/generic/7segled.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* (C) Copyright TOSHIBA CORPORATION 2005-2007
* All Rights Reserved.
*/
#include <linux/sysdev.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/map_to_7segment.h>
#include <asm/txx9/generic.h>
Expand Down Expand Up @@ -37,37 +37,37 @@ int txx9_7segled_putc(unsigned int pos, char c)
return 0;
}

static ssize_t ascii_store(struct sys_device *dev,
struct sysdev_attribute *attr,
static ssize_t ascii_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
unsigned int ch = dev->id;
txx9_7segled_putc(ch, buf[0]);
return size;
}

static ssize_t raw_store(struct sys_device *dev,
struct sysdev_attribute *attr,
static ssize_t raw_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
unsigned int ch = dev->id;
tx_7segled_putc(ch, buf[0]);
return size;
}

static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store);
static SYSDEV_ATTR(raw, 0200, NULL, raw_store);
static DEVICE_ATTR(ascii, 0200, NULL, ascii_store);
static DEVICE_ATTR(raw, 0200, NULL, raw_store);

static ssize_t map_seg7_show(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
static ssize_t map_seg7_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
return sizeof(txx9_seg7map);
}

static ssize_t map_seg7_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
static ssize_t map_seg7_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t size)
{
if (size != sizeof(txx9_seg7map))
Expand All @@ -76,37 +76,37 @@ static ssize_t map_seg7_store(struct sysdev_class *class,
return size;
}

static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);

static struct sysdev_class tx_7segled_sysdev_class = {
.name = "7segled",
static struct bus_type tx_7segled_subsys = {
.name = "7segled",
.dev_name = "7segled",
};

static int __init tx_7segled_init_sysfs(void)
{
int error, i;
if (!tx_7segled_num)
return -ENODEV;
error = sysdev_class_register(&tx_7segled_sysdev_class);
error = subsys_system_register(&tx_7segled_subsys, NULL);
if (error)
return error;
error = sysdev_class_create_file(&tx_7segled_sysdev_class,
&attr_map_seg7);
error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7);
if (error)
return error;
for (i = 0; i < tx_7segled_num; i++) {
struct sys_device *dev;
struct device *dev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
error = -ENODEV;
break;
}
dev->id = i;
dev->cls = &tx_7segled_sysdev_class;
error = sysdev_register(dev);
dev->dev = &tx_7segled_subsys;
error = device_register(dev);
if (!error) {
sysdev_create_file(dev, &attr_ascii);
sysdev_create_file(dev, &attr_raw);
device_create_file(dev, &dev_attr_ascii);
device_create_file(dev, &dev_attr_raw);
}
}
return error;
Expand Down

0 comments on commit 3ba3ff7

Please sign in to comment.