diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 19:00:22 +0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 19:00:22 +0400 |
commit | 4de3a8e101150feaefa1139611a50ff37467f33e (patch) | |
tree | daada742542518b02d7db7c5d32e715eaa5f166d /arch/mips/txx9/generic/setup.c | |
parent | 294064f58953f9964e5945424b09c51800330a83 (diff) | |
parent | 099469502f62fbe0d7e4f0b83a2f22538367f734 (diff) | |
download | linux-4de3a8e101150feaefa1139611a50ff37467f33e.tar.xz |
Merge branch 'master' into fixes
Diffstat (limited to 'arch/mips/txx9/generic/setup.c')
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c index ec38e00b2559..ae77a7916c03 100644 --- a/arch/mips/txx9/generic/setup.c +++ b/arch/mips/txx9/generic/setup.c @@ -22,7 +22,7 @@ #include <linux/serial_core.h> #include <linux/mtd/physmap.h> #include <linux/leds.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/slab.h> #include <linux/irq.h> #include <asm/bootinfo.h> @@ -897,10 +897,13 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq, #endif } -static struct sysdev_class txx9_sramc_sysdev_class; +static struct bus_type txx9_sramc_subsys = { + .name = "txx9_sram", + .dev_name = "txx9_sram", +}; -struct txx9_sramc_sysdev { - struct sys_device dev; +struct txx9_sramc_dev { + struct device dev; struct bin_attribute bindata_attr; void __iomem *base; }; @@ -909,7 +912,7 @@ static ssize_t txx9_sram_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t size) { - struct txx9_sramc_sysdev *dev = bin_attr->private; + struct txx9_sramc_dev *dev = bin_attr->private; size_t ramsize = bin_attr->size; if (pos >= ramsize) @@ -924,7 +927,7 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t size) { - struct txx9_sramc_sysdev *dev = bin_attr->private; + struct txx9_sramc_dev *dev = bin_attr->private; size_t ramsize = bin_attr->size; if (pos >= ramsize) @@ -937,18 +940,13 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj, void __init txx9_sramc_init(struct resource *r) { - struct txx9_sramc_sysdev *dev; + struct txx9_sramc_dev *dev; size_t size; int err; - if (!txx9_sramc_sysdev_class.name) { - txx9_sramc_sysdev_class.name = "txx9_sram"; - err = sysdev_class_register(&txx9_sramc_sysdev_class); - if (err) { - txx9_sramc_sysdev_class.name = NULL; - return; - } - } + err = subsys_system_register(&txx9_sramc_subsys, NULL); + if (err) + return; dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return; @@ -956,7 +954,7 @@ void __init txx9_sramc_init(struct resource *r) dev->base = ioremap(r->start, size); if (!dev->base) goto exit; - dev->dev.cls = &txx9_sramc_sysdev_class; + dev->dev.bus = &txx9_sramc_subsys; sysfs_bin_attr_init(&dev->bindata_attr); dev->bindata_attr.attr.name = "bindata"; dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; @@ -964,12 +962,12 @@ void __init txx9_sramc_init(struct resource *r) dev->bindata_attr.write = txx9_sram_write; dev->bindata_attr.size = size; dev->bindata_attr.private = dev; - err = sysdev_register(&dev->dev); + err = device_register(&dev->dev); if (err) goto exit; err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); if (err) { - sysdev_unregister(&dev->dev); + device_unregister(&dev->dev); goto exit; } return; |