diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
commit | 7affca3537d74365128e477b40c529d6f2fe86c8 (patch) | |
tree | 20be92bd240029182fc89c2c4f25401b7715dcae /arch/mips | |
parent | 356b95424cfb456e14a59eaa579422ce014c424b (diff) | |
parent | ff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (diff) |
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
arm: fix up some samsung merge sysdev conversion problems
firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
Drivers:hv: Fix a bug in vmbus_driver_unregister()
driver core: remove __must_check from device_create_file
debugfs: add missing #ifdef HAS_IOMEM
arm: time.h: remove device.h #include
driver-core: remove sysdev.h usage.
clockevents: remove sysdev.h
arm: convert sysdev_class to a regular subsystem
arm: leds: convert sysdev_class to a regular subsystem
kobject: remove kset_find_obj_hinted()
m86k: gpio - convert sysdev_class to a regular subsystem
mips: txx9_sram - convert sysdev_class to a regular subsystem
mips: 7segled - convert sysdev_class to a regular subsystem
sh: dma - convert sysdev_class to a regular subsystem
sh: intc - convert sysdev_class to a regular subsystem
power: suspend - convert sysdev_class to a regular subsystem
power: qe_ic - convert sysdev_class to a regular subsystem
power: cmm - convert sysdev_class to a regular subsystem
s390: time - convert sysdev_class to a regular subsystem
...
Fix up conflicts with 'struct sysdev' removal from various platform
drivers that got changed:
- arch/arm/mach-exynos/cpu.c
- arch/arm/mach-exynos/irq-eint.c
- arch/arm/mach-s3c64xx/common.c
- arch/arm/mach-s3c64xx/cpu.c
- arch/arm/mach-s5p64x0/cpu.c
- arch/arm/mach-s5pv210/common.c
- arch/arm/plat-samsung/include/plat/cpu.h
- arch/powerpc/kernel/sysfs.c
and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/txx9/generic/7segled.c | 44 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup.c | 34 | ||||
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4939.c | 2 |
3 files changed, 39 insertions, 41 deletions
diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c index 7f8416f86222..8e93b2122524 100644 --- a/arch/mips/txx9/generic/7segled.c +++ b/arch/mips/txx9/generic/7segled.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * (C) Copyright TOSHIBA CORPORATION 2005-2007 | 9 | * (C) Copyright TOSHIBA CORPORATION 2005-2007 |
10 | * All Rights Reserved. | 10 | * All Rights Reserved. |
11 | */ | 11 | */ |
12 | #include <linux/sysdev.h> | 12 | #include <linux/device.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/map_to_7segment.h> | 14 | #include <linux/map_to_7segment.h> |
15 | #include <asm/txx9/generic.h> | 15 | #include <asm/txx9/generic.h> |
@@ -37,8 +37,8 @@ int txx9_7segled_putc(unsigned int pos, char c) | |||
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static ssize_t ascii_store(struct sys_device *dev, | 40 | static ssize_t ascii_store(struct device *dev, |
41 | struct sysdev_attribute *attr, | 41 | struct device_attribute *attr, |
42 | const char *buf, size_t size) | 42 | const char *buf, size_t size) |
43 | { | 43 | { |
44 | unsigned int ch = dev->id; | 44 | unsigned int ch = dev->id; |
@@ -46,8 +46,8 @@ static ssize_t ascii_store(struct sys_device *dev, | |||
46 | return size; | 46 | return size; |
47 | } | 47 | } |
48 | 48 | ||
49 | static ssize_t raw_store(struct sys_device *dev, | 49 | static ssize_t raw_store(struct device *dev, |
50 | struct sysdev_attribute *attr, | 50 | struct device_attribute *attr, |
51 | const char *buf, size_t size) | 51 | const char *buf, size_t size) |
52 | { | 52 | { |
53 | unsigned int ch = dev->id; | 53 | unsigned int ch = dev->id; |
@@ -55,19 +55,19 @@ static ssize_t raw_store(struct sys_device *dev, | |||
55 | return size; | 55 | return size; |
56 | } | 56 | } |
57 | 57 | ||
58 | static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); | 58 | static DEVICE_ATTR(ascii, 0200, NULL, ascii_store); |
59 | static SYSDEV_ATTR(raw, 0200, NULL, raw_store); | 59 | static DEVICE_ATTR(raw, 0200, NULL, raw_store); |
60 | 60 | ||
61 | static ssize_t map_seg7_show(struct sysdev_class *class, | 61 | static ssize_t map_seg7_show(struct device *dev, |
62 | struct sysdev_class_attribute *attr, | 62 | struct device_attribute *attr, |
63 | char *buf) | 63 | char *buf) |
64 | { | 64 | { |
65 | memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); | 65 | memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); |
66 | return sizeof(txx9_seg7map); | 66 | return sizeof(txx9_seg7map); |
67 | } | 67 | } |
68 | 68 | ||
69 | static ssize_t map_seg7_store(struct sysdev_class *class, | 69 | static ssize_t map_seg7_store(struct device *dev, |
70 | struct sysdev_class_attribute *attr, | 70 | struct device_attribute *attr, |
71 | const char *buf, size_t size) | 71 | const char *buf, size_t size) |
72 | { | 72 | { |
73 | if (size != sizeof(txx9_seg7map)) | 73 | if (size != sizeof(txx9_seg7map)) |
@@ -76,10 +76,11 @@ static ssize_t map_seg7_store(struct sysdev_class *class, | |||
76 | return size; | 76 | return size; |
77 | } | 77 | } |
78 | 78 | ||
79 | static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); | 79 | static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); |
80 | 80 | ||
81 | static struct sysdev_class tx_7segled_sysdev_class = { | 81 | static struct bus_type tx_7segled_subsys = { |
82 | .name = "7segled", | 82 | .name = "7segled", |
83 | .dev_name = "7segled", | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | static int __init tx_7segled_init_sysfs(void) | 86 | static int __init tx_7segled_init_sysfs(void) |
@@ -87,26 +88,25 @@ static int __init tx_7segled_init_sysfs(void) | |||
87 | int error, i; | 88 | int error, i; |
88 | if (!tx_7segled_num) | 89 | if (!tx_7segled_num) |
89 | return -ENODEV; | 90 | return -ENODEV; |
90 | error = sysdev_class_register(&tx_7segled_sysdev_class); | 91 | error = subsys_system_register(&tx_7segled_subsys, NULL); |
91 | if (error) | 92 | if (error) |
92 | return error; | 93 | return error; |
93 | error = sysdev_class_create_file(&tx_7segled_sysdev_class, | 94 | error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7); |
94 | &attr_map_seg7); | ||
95 | if (error) | 95 | if (error) |
96 | return error; | 96 | return error; |
97 | for (i = 0; i < tx_7segled_num; i++) { | 97 | for (i = 0; i < tx_7segled_num; i++) { |
98 | struct sys_device *dev; | 98 | struct device *dev; |
99 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 99 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
100 | if (!dev) { | 100 | if (!dev) { |
101 | error = -ENODEV; | 101 | error = -ENODEV; |
102 | break; | 102 | break; |
103 | } | 103 | } |
104 | dev->id = i; | 104 | dev->id = i; |
105 | dev->cls = &tx_7segled_sysdev_class; | 105 | dev->dev = &tx_7segled_subsys; |
106 | error = sysdev_register(dev); | 106 | error = device_register(dev); |
107 | if (!error) { | 107 | if (!error) { |
108 | sysdev_create_file(dev, &attr_ascii); | 108 | device_create_file(dev, &dev_attr_ascii); |
109 | sysdev_create_file(dev, &attr_raw); | 109 | device_create_file(dev, &dev_attr_raw); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | return error; | 112 | return error; |
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 @@ | |||
22 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
23 | #include <linux/mtd/physmap.h> | 23 | #include <linux/mtd/physmap.h> |
24 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/device.h> |
26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
27 | #include <linux/irq.h> | 27 | #include <linux/irq.h> |
28 | #include <asm/bootinfo.h> | 28 | #include <asm/bootinfo.h> |
@@ -897,10 +897,13 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq, | |||
897 | #endif | 897 | #endif |
898 | } | 898 | } |
899 | 899 | ||
900 | static struct sysdev_class txx9_sramc_sysdev_class; | 900 | static struct bus_type txx9_sramc_subsys = { |
901 | .name = "txx9_sram", | ||
902 | .dev_name = "txx9_sram", | ||
903 | }; | ||
901 | 904 | ||
902 | struct txx9_sramc_sysdev { | 905 | struct txx9_sramc_dev { |
903 | struct sys_device dev; | 906 | struct device dev; |
904 | struct bin_attribute bindata_attr; | 907 | struct bin_attribute bindata_attr; |
905 | void __iomem *base; | 908 | void __iomem *base; |
906 | }; | 909 | }; |
@@ -909,7 +912,7 @@ static ssize_t txx9_sram_read(struct file *filp, struct kobject *kobj, | |||
909 | struct bin_attribute *bin_attr, | 912 | struct bin_attribute *bin_attr, |
910 | char *buf, loff_t pos, size_t size) | 913 | char *buf, loff_t pos, size_t size) |
911 | { | 914 | { |
912 | struct txx9_sramc_sysdev *dev = bin_attr->private; | 915 | struct txx9_sramc_dev *dev = bin_attr->private; |
913 | size_t ramsize = bin_attr->size; | 916 | size_t ramsize = bin_attr->size; |
914 | 917 | ||
915 | if (pos >= ramsize) | 918 | if (pos >= ramsize) |
@@ -924,7 +927,7 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj, | |||
924 | struct bin_attribute *bin_attr, | 927 | struct bin_attribute *bin_attr, |
925 | char *buf, loff_t pos, size_t size) | 928 | char *buf, loff_t pos, size_t size) |
926 | { | 929 | { |
927 | struct txx9_sramc_sysdev *dev = bin_attr->private; | 930 | struct txx9_sramc_dev *dev = bin_attr->private; |
928 | size_t ramsize = bin_attr->size; | 931 | size_t ramsize = bin_attr->size; |
929 | 932 | ||
930 | if (pos >= ramsize) | 933 | if (pos >= ramsize) |
@@ -937,18 +940,13 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj, | |||
937 | 940 | ||
938 | void __init txx9_sramc_init(struct resource *r) | 941 | void __init txx9_sramc_init(struct resource *r) |
939 | { | 942 | { |
940 | struct txx9_sramc_sysdev *dev; | 943 | struct txx9_sramc_dev *dev; |
941 | size_t size; | 944 | size_t size; |
942 | int err; | 945 | int err; |
943 | 946 | ||
944 | if (!txx9_sramc_sysdev_class.name) { | 947 | err = subsys_system_register(&txx9_sramc_subsys, NULL); |
945 | txx9_sramc_sysdev_class.name = "txx9_sram"; | 948 | if (err) |
946 | err = sysdev_class_register(&txx9_sramc_sysdev_class); | 949 | return; |
947 | if (err) { | ||
948 | txx9_sramc_sysdev_class.name = NULL; | ||
949 | return; | ||
950 | } | ||
951 | } | ||
952 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 950 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
953 | if (!dev) | 951 | if (!dev) |
954 | return; | 952 | return; |
@@ -956,7 +954,7 @@ void __init txx9_sramc_init(struct resource *r) | |||
956 | dev->base = ioremap(r->start, size); | 954 | dev->base = ioremap(r->start, size); |
957 | if (!dev->base) | 955 | if (!dev->base) |
958 | goto exit; | 956 | goto exit; |
959 | dev->dev.cls = &txx9_sramc_sysdev_class; | 957 | dev->dev.bus = &txx9_sramc_subsys; |
960 | sysfs_bin_attr_init(&dev->bindata_attr); | 958 | sysfs_bin_attr_init(&dev->bindata_attr); |
961 | dev->bindata_attr.attr.name = "bindata"; | 959 | dev->bindata_attr.attr.name = "bindata"; |
962 | dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; | 960 | dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; |
@@ -964,12 +962,12 @@ void __init txx9_sramc_init(struct resource *r) | |||
964 | dev->bindata_attr.write = txx9_sram_write; | 962 | dev->bindata_attr.write = txx9_sram_write; |
965 | dev->bindata_attr.size = size; | 963 | dev->bindata_attr.size = size; |
966 | dev->bindata_attr.private = dev; | 964 | dev->bindata_attr.private = dev; |
967 | err = sysdev_register(&dev->dev); | 965 | err = device_register(&dev->dev); |
968 | if (err) | 966 | if (err) |
969 | goto exit; | 967 | goto exit; |
970 | err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); | 968 | err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); |
971 | if (err) { | 969 | if (err) { |
972 | sysdev_unregister(&dev->dev); | 970 | device_unregister(&dev->dev); |
973 | goto exit; | 971 | goto exit; |
974 | } | 972 | } |
975 | return; | 973 | return; |
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c index ba3cec3155df..6567895d1f59 100644 --- a/arch/mips/txx9/generic/setup_tx4939.c +++ b/arch/mips/txx9/generic/setup_tx4939.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/device.h> |
19 | #include <linux/ethtool.h> | 19 | #include <linux/ethtool.h> |
20 | #include <linux/param.h> | 20 | #include <linux/param.h> |
21 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |