aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-14 13:42:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-14 13:42:40 -0500
commit3e2b32b69308e974cd1167beaf266d3c716e4734 (patch)
tree0f1b24dcb7b066a6322d33235b95655d885695ac /arch
parent3824ba7df91745da6ebac703c87c3b801c34fdd0 (diff)
parent9c08a938ce5a3e1c9d5f764dc6ae844cb1af76ff (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/locomo.c4
-rw-r--r--arch/arm/common/sa1111.c4
-rw-r--r--arch/arm/kernel/ecard.c14
-rw-r--r--arch/arm/mach-integrator/lm.c36
-rw-r--r--arch/ia64/sn/kernel/tiocx.c16
-rw-r--r--arch/parisc/kernel/drivers.c4
-rw-r--r--arch/powerpc/kernel/of_device.c4
-rw-r--r--arch/powerpc/kernel/vio.c8
-rw-r--r--arch/ppc/syslib/ocp.c4
-rw-r--r--arch/sh/kernel/cpu/bus.c34
10 files changed, 65 insertions, 63 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 1b7eaab02b9e..159ad7ed7a40 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -1103,14 +1103,14 @@ static int locomo_bus_remove(struct device *dev)
1103struct bus_type locomo_bus_type = { 1103struct bus_type locomo_bus_type = {
1104 .name = "locomo-bus", 1104 .name = "locomo-bus",
1105 .match = locomo_match, 1105 .match = locomo_match,
1106 .probe = locomo_bus_probe,
1107 .remove = locomo_bus_remove,
1106 .suspend = locomo_bus_suspend, 1108 .suspend = locomo_bus_suspend,
1107 .resume = locomo_bus_resume, 1109 .resume = locomo_bus_resume,
1108}; 1110};
1109 1111
1110int locomo_driver_register(struct locomo_driver *driver) 1112int locomo_driver_register(struct locomo_driver *driver)
1111{ 1113{
1112 driver->drv.probe = locomo_bus_probe;
1113 driver->drv.remove = locomo_bus_remove;
1114 driver->drv.bus = &locomo_bus_type; 1114 driver->drv.bus = &locomo_bus_type;
1115 return driver_register(&driver->drv); 1115 return driver_register(&driver->drv);
1116} 1116}
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index d0d6e6d2d649..1475089f9b42 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -1247,14 +1247,14 @@ static int sa1111_bus_remove(struct device *dev)
1247struct bus_type sa1111_bus_type = { 1247struct bus_type sa1111_bus_type = {
1248 .name = "sa1111-rab", 1248 .name = "sa1111-rab",
1249 .match = sa1111_match, 1249 .match = sa1111_match,
1250 .probe = sa1111_bus_probe,
1251 .remove = sa1111_bus_remove,
1250 .suspend = sa1111_bus_suspend, 1252 .suspend = sa1111_bus_suspend,
1251 .resume = sa1111_bus_resume, 1253 .resume = sa1111_bus_resume,
1252}; 1254};
1253 1255
1254int sa1111_driver_register(struct sa1111_driver *driver) 1256int sa1111_driver_register(struct sa1111_driver *driver)
1255{ 1257{
1256 driver->drv.probe = sa1111_bus_probe;
1257 driver->drv.remove = sa1111_bus_remove;
1258 driver->drv.bus = &sa1111_bus_type; 1258 driver->drv.bus = &sa1111_bus_type;
1259 return driver_register(&driver->drv); 1259 return driver_register(&driver->drv);
1260} 1260}
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 96fd91926c9b..74ea29c3205e 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -1147,9 +1147,11 @@ static void ecard_drv_shutdown(struct device *dev)
1147 struct ecard_driver *drv = ECARD_DRV(dev->driver); 1147 struct ecard_driver *drv = ECARD_DRV(dev->driver);
1148 struct ecard_request req; 1148 struct ecard_request req;
1149 1149
1150 if (drv->shutdown) 1150 if (dev->driver) {
1151 drv->shutdown(ec); 1151 if (drv->shutdown)
1152 ecard_release(ec); 1152 drv->shutdown(ec);
1153 ecard_release(ec);
1154 }
1153 1155
1154 /* 1156 /*
1155 * If this card has a loader, call the reset handler. 1157 * If this card has a loader, call the reset handler.
@@ -1164,9 +1166,6 @@ static void ecard_drv_shutdown(struct device *dev)
1164int ecard_register_driver(struct ecard_driver *drv) 1166int ecard_register_driver(struct ecard_driver *drv)
1165{ 1167{
1166 drv->drv.bus = &ecard_bus_type; 1168 drv->drv.bus = &ecard_bus_type;
1167 drv->drv.probe = ecard_drv_probe;
1168 drv->drv.remove = ecard_drv_remove;
1169 drv->drv.shutdown = ecard_drv_shutdown;
1170 1169
1171 return driver_register(&drv->drv); 1170 return driver_register(&drv->drv);
1172} 1171}
@@ -1195,6 +1194,9 @@ struct bus_type ecard_bus_type = {
1195 .name = "ecard", 1194 .name = "ecard",
1196 .dev_attrs = ecard_dev_attrs, 1195 .dev_attrs = ecard_dev_attrs,
1197 .match = ecard_match, 1196 .match = ecard_match,
1197 .probe = ecard_drv_probe,
1198 .remove = ecard_drv_remove,
1199 .shutdown = ecard_drv_shutdown,
1198}; 1200};
1199 1201
1200static int ecard_bus_init(void) 1202static int ecard_bus_init(void)
diff --git a/arch/arm/mach-integrator/lm.c b/arch/arm/mach-integrator/lm.c
index 5b41e3a724e1..622cdc4212dd 100644
--- a/arch/arm/mach-integrator/lm.c
+++ b/arch/arm/mach-integrator/lm.c
@@ -22,20 +22,6 @@ static int lm_match(struct device *dev, struct device_driver *drv)
22 return 1; 22 return 1;
23} 23}
24 24
25static struct bus_type lm_bustype = {
26 .name = "logicmodule",
27 .match = lm_match,
28// .suspend = lm_suspend,
29// .resume = lm_resume,
30};
31
32static int __init lm_init(void)
33{
34 return bus_register(&lm_bustype);
35}
36
37postcore_initcall(lm_init);
38
39static int lm_bus_probe(struct device *dev) 25static int lm_bus_probe(struct device *dev)
40{ 26{
41 struct lm_device *lmdev = to_lm_device(dev); 27 struct lm_device *lmdev = to_lm_device(dev);
@@ -49,16 +35,30 @@ static int lm_bus_remove(struct device *dev)
49 struct lm_device *lmdev = to_lm_device(dev); 35 struct lm_device *lmdev = to_lm_device(dev);
50 struct lm_driver *lmdrv = to_lm_driver(dev->driver); 36 struct lm_driver *lmdrv = to_lm_driver(dev->driver);
51 37
52 lmdrv->remove(lmdev); 38 if (lmdrv->remove)
39 lmdrv->remove(lmdev);
53 return 0; 40 return 0;
54} 41}
55 42
43static struct bus_type lm_bustype = {
44 .name = "logicmodule",
45 .match = lm_match,
46 .probe = lm_bus_probe,
47 .remove = lm_bus_remove,
48// .suspend = lm_bus_suspend,
49// .resume = lm_bus_resume,
50};
51
52static int __init lm_init(void)
53{
54 return bus_register(&lm_bustype);
55}
56
57postcore_initcall(lm_init);
58
56int lm_driver_register(struct lm_driver *drv) 59int lm_driver_register(struct lm_driver *drv)
57{ 60{
58 drv->drv.bus = &lm_bustype; 61 drv->drv.bus = &lm_bustype;
59 drv->drv.probe = lm_bus_probe;
60 drv->drv.remove = lm_bus_remove;
61
62 return driver_register(&drv->drv); 62 return driver_register(&drv->drv);
63} 63}
64 64
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 493fb3f38dc3..6a7939b16a1c 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -77,12 +77,6 @@ static void tiocx_bus_release(struct device *dev)
77 kfree(to_cx_dev(dev)); 77 kfree(to_cx_dev(dev));
78} 78}
79 79
80struct bus_type tiocx_bus_type = {
81 .name = "tiocx",
82 .match = tiocx_match,
83 .uevent = tiocx_uevent,
84};
85
86/** 80/**
87 * cx_device_match - Find cx_device in the id table. 81 * cx_device_match - Find cx_device in the id table.
88 * @ids: id table from driver 82 * @ids: id table from driver
@@ -149,6 +143,14 @@ static int cx_driver_remove(struct device *dev)
149 return 0; 143 return 0;
150} 144}
151 145
146struct bus_type tiocx_bus_type = {
147 .name = "tiocx",
148 .match = tiocx_match,
149 .uevent = tiocx_uevent,
150 .probe = cx_device_probe,
151 .remove = cx_driver_remove,
152};
153
152/** 154/**
153 * cx_driver_register - Register the driver. 155 * cx_driver_register - Register the driver.
154 * @cx_driver: driver table (cx_drv struct) from driver 156 * @cx_driver: driver table (cx_drv struct) from driver
@@ -162,8 +164,6 @@ int cx_driver_register(struct cx_drv *cx_driver)
162{ 164{
163 cx_driver->driver.name = cx_driver->name; 165 cx_driver->driver.name = cx_driver->name;
164 cx_driver->driver.bus = &tiocx_bus_type; 166 cx_driver->driver.bus = &tiocx_bus_type;
165 cx_driver->driver.probe = cx_device_probe;
166 cx_driver->driver.remove = cx_driver_remove;
167 167
168 return driver_register(&cx_driver->driver); 168 return driver_register(&cx_driver->driver);
169} 169}
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 1eaa0d37f677..2d804e2d16d1 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -173,8 +173,6 @@ int register_parisc_driver(struct parisc_driver *driver)
173 WARN_ON(driver->drv.probe != NULL); 173 WARN_ON(driver->drv.probe != NULL);
174 WARN_ON(driver->drv.remove != NULL); 174 WARN_ON(driver->drv.remove != NULL);
175 175
176 driver->drv.probe = parisc_driver_probe;
177 driver->drv.remove = parisc_driver_remove;
178 driver->drv.name = driver->name; 176 driver->drv.name = driver->name;
179 177
180 return driver_register(&driver->drv); 178 return driver_register(&driver->drv);
@@ -575,6 +573,8 @@ struct bus_type parisc_bus_type = {
575 .name = "parisc", 573 .name = "parisc",
576 .match = parisc_generic_match, 574 .match = parisc_generic_match,
577 .dev_attrs = parisc_device_attrs, 575 .dev_attrs = parisc_device_attrs,
576 .probe = parisc_driver_probe,
577 .remove = parisc_driver_remove,
578}; 578};
579 579
580/** 580/**
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 7065e40e2f42..22d83d4d1af5 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -132,6 +132,8 @@ static int of_device_resume(struct device * dev)
132struct bus_type of_platform_bus_type = { 132struct bus_type of_platform_bus_type = {
133 .name = "of_platform", 133 .name = "of_platform",
134 .match = of_platform_bus_match, 134 .match = of_platform_bus_match,
135 .probe = of_device_probe,
136 .remove = of_device_remove,
135 .suspend = of_device_suspend, 137 .suspend = of_device_suspend,
136 .resume = of_device_resume, 138 .resume = of_device_resume,
137}; 139};
@@ -150,8 +152,6 @@ int of_register_driver(struct of_platform_driver *drv)
150 /* initialize common driver fields */ 152 /* initialize common driver fields */
151 drv->driver.name = drv->name; 153 drv->driver.name = drv->name;
152 drv->driver.bus = &of_platform_bus_type; 154 drv->driver.bus = &of_platform_bus_type;
153 drv->driver.probe = of_device_probe;
154 drv->driver.remove = of_device_remove;
155 155
156 /* register with core */ 156 /* register with core */
157 count = driver_register(&drv->driver); 157 count = driver_register(&drv->driver);
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 13c41495fe06..13c655ba2841 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -76,7 +76,7 @@ static void vio_bus_shutdown(struct device *dev)
76 struct vio_dev *viodev = to_vio_dev(dev); 76 struct vio_dev *viodev = to_vio_dev(dev);
77 struct vio_driver *viodrv = to_vio_driver(dev->driver); 77 struct vio_driver *viodrv = to_vio_driver(dev->driver);
78 78
79 if (viodrv->shutdown) 79 if (dev->driver && viodrv->shutdown)
80 viodrv->shutdown(viodev); 80 viodrv->shutdown(viodev);
81} 81}
82 82
@@ -91,9 +91,6 @@ int vio_register_driver(struct vio_driver *viodrv)
91 91
92 /* fill in 'struct driver' fields */ 92 /* fill in 'struct driver' fields */
93 viodrv->driver.bus = &vio_bus_type; 93 viodrv->driver.bus = &vio_bus_type;
94 viodrv->driver.probe = vio_bus_probe;
95 viodrv->driver.remove = vio_bus_remove;
96 viodrv->driver.shutdown = vio_bus_shutdown;
97 94
98 return driver_register(&viodrv->driver); 95 return driver_register(&viodrv->driver);
99} 96}
@@ -295,4 +292,7 @@ struct bus_type vio_bus_type = {
295 .name = "vio", 292 .name = "vio",
296 .uevent = vio_hotplug, 293 .uevent = vio_hotplug,
297 .match = vio_bus_match, 294 .match = vio_bus_match,
295 .probe = vio_bus_probe,
296 .remove = vio_bus_remove,
297 .shutdown = vio_bus_shutdown,
298}; 298};
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 9ccce438bd7a..ab34b1d6072f 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -189,6 +189,8 @@ ocp_device_resume(struct device *dev)
189struct bus_type ocp_bus_type = { 189struct bus_type ocp_bus_type = {
190 .name = "ocp", 190 .name = "ocp",
191 .match = ocp_device_match, 191 .match = ocp_device_match,
192 .probe = ocp_driver_probe,
193 .remove = ocp_driver_remove,
192 .suspend = ocp_device_suspend, 194 .suspend = ocp_device_suspend,
193 .resume = ocp_device_resume, 195 .resume = ocp_device_resume,
194}; 196};
@@ -210,8 +212,6 @@ ocp_register_driver(struct ocp_driver *drv)
210 /* initialize common driver fields */ 212 /* initialize common driver fields */
211 drv->driver.name = drv->name; 213 drv->driver.name = drv->name;
212 drv->driver.bus = &ocp_bus_type; 214 drv->driver.bus = &ocp_bus_type;
213 drv->driver.probe = ocp_device_probe;
214 drv->driver.remove = ocp_device_remove;
215 215
216 /* register with core */ 216 /* register with core */
217 return driver_register(&drv->driver); 217 return driver_register(&drv->driver);
diff --git a/arch/sh/kernel/cpu/bus.c b/arch/sh/kernel/cpu/bus.c
index d4fee2a79373..3278d234bb1b 100644
--- a/arch/sh/kernel/cpu/bus.c
+++ b/arch/sh/kernel/cpu/bus.c
@@ -53,21 +53,6 @@ static int sh_bus_resume(struct device *dev)
53 return 0; 53 return 0;
54} 54}
55 55
56static struct device sh_bus_devices[SH_NR_BUSES] = {
57 {
58 .bus_id = SH_BUS_NAME_VIRT,
59 },
60};
61
62struct bus_type sh_bus_types[SH_NR_BUSES] = {
63 {
64 .name = SH_BUS_NAME_VIRT,
65 .match = sh_bus_match,
66 .suspend = sh_bus_suspend,
67 .resume = sh_bus_resume,
68 },
69};
70
71static int sh_device_probe(struct device *dev) 56static int sh_device_probe(struct device *dev)
72{ 57{
73 struct sh_dev *shdev = to_sh_dev(dev); 58 struct sh_dev *shdev = to_sh_dev(dev);
@@ -90,6 +75,23 @@ static int sh_device_remove(struct device *dev)
90 return 0; 75 return 0;
91} 76}
92 77
78static struct device sh_bus_devices[SH_NR_BUSES] = {
79 {
80 .bus_id = SH_BUS_NAME_VIRT,
81 },
82};
83
84struct bus_type sh_bus_types[SH_NR_BUSES] = {
85 {
86 .name = SH_BUS_NAME_VIRT,
87 .match = sh_bus_match,
88 .probe = sh_bus_probe,
89 .remove = sh_bus_remove,
90 .suspend = sh_bus_suspend,
91 .resume = sh_bus_resume,
92 },
93};
94
93int sh_device_register(struct sh_dev *dev) 95int sh_device_register(struct sh_dev *dev)
94{ 96{
95 if (!dev) 97 if (!dev)
@@ -133,8 +135,6 @@ int sh_driver_register(struct sh_driver *drv)
133 return -EINVAL; 135 return -EINVAL;
134 } 136 }
135 137
136 drv->drv.probe = sh_device_probe;
137 drv->drv.remove = sh_device_remove;
138 drv->drv.bus = &sh_bus_types[drv->bus_id]; 138 drv->drv.bus = &sh_bus_types[drv->bus_id];
139 139
140 return driver_register(&drv->drv); 140 return driver_register(&drv->drv);