diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2007-09-26 05:45:51 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-17 08:30:08 -0400 |
commit | 6b08f3ae8eec27a9e557468a48540bc64fd4a524 (patch) | |
tree | 0739be87e3262ddef0535949186670f4ae5eb850 /arch | |
parent | 55347cc9962fbf2048a3cf78e92c3f52035ac524 (diff) |
[POWERPC] ibmebus: Move to of_device and of_platform_driver, match eHCA and eHEA drivers
Replace struct ibmebus_dev and struct ibmebus_driver with struct of_device
and struct of_platform_driver, respectively. Match the external ibmebus
interface and drivers using it.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index d21658140b6e..289d7e935918 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -193,21 +193,26 @@ static int ibmebus_create_devices(const struct of_device_id *matches) | |||
193 | return ret; | 193 | return ret; |
194 | } | 194 | } |
195 | 195 | ||
196 | int ibmebus_register_driver(struct ibmebus_driver *drv) | 196 | int ibmebus_register_driver(struct of_platform_driver *drv) |
197 | { | 197 | { |
198 | return 0; | 198 | /* If the driver uses devices that ibmebus doesn't know, add them */ |
199 | ibmebus_create_devices(drv->match_table); | ||
200 | |||
201 | drv->driver.name = drv->name; | ||
202 | drv->driver.bus = &ibmebus_bus_type; | ||
203 | |||
204 | return driver_register(&drv->driver); | ||
199 | } | 205 | } |
200 | EXPORT_SYMBOL(ibmebus_register_driver); | 206 | EXPORT_SYMBOL(ibmebus_register_driver); |
201 | 207 | ||
202 | void ibmebus_unregister_driver(struct ibmebus_driver *drv) | 208 | void ibmebus_unregister_driver(struct of_platform_driver *drv) |
203 | { | 209 | { |
210 | driver_unregister(&drv->driver); | ||
204 | } | 211 | } |
205 | EXPORT_SYMBOL(ibmebus_unregister_driver); | 212 | EXPORT_SYMBOL(ibmebus_unregister_driver); |
206 | 213 | ||
207 | int ibmebus_request_irq(struct ibmebus_dev *dev, | 214 | int ibmebus_request_irq(u32 ist, irq_handler_t handler, |
208 | u32 ist, | 215 | unsigned long irq_flags, const char *devname, |
209 | irq_handler_t handler, | ||
210 | unsigned long irq_flags, const char * devname, | ||
211 | void *dev_id) | 216 | void *dev_id) |
212 | { | 217 | { |
213 | unsigned int irq = irq_create_mapping(NULL, ist); | 218 | unsigned int irq = irq_create_mapping(NULL, ist); |
@@ -215,12 +220,11 @@ int ibmebus_request_irq(struct ibmebus_dev *dev, | |||
215 | if (irq == NO_IRQ) | 220 | if (irq == NO_IRQ) |
216 | return -EINVAL; | 221 | return -EINVAL; |
217 | 222 | ||
218 | return request_irq(irq, handler, | 223 | return request_irq(irq, handler, irq_flags, devname, dev_id); |
219 | irq_flags, devname, dev_id); | ||
220 | } | 224 | } |
221 | EXPORT_SYMBOL(ibmebus_request_irq); | 225 | EXPORT_SYMBOL(ibmebus_request_irq); |
222 | 226 | ||
223 | void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id) | 227 | void ibmebus_free_irq(u32 ist, void *dev_id) |
224 | { | 228 | { |
225 | unsigned int irq = irq_find_mapping(NULL, ist); | 229 | unsigned int irq = irq_find_mapping(NULL, ist); |
226 | 230 | ||
@@ -231,9 +235,7 @@ EXPORT_SYMBOL(ibmebus_free_irq); | |||
231 | static ssize_t name_show(struct device *dev, | 235 | static ssize_t name_show(struct device *dev, |
232 | struct device_attribute *attr, char *buf) | 236 | struct device_attribute *attr, char *buf) |
233 | { | 237 | { |
234 | struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev); | 238 | return sprintf(buf, "%s\n", to_of_device(dev)->node->name); |
235 | const char *name = of_get_property(ebus_dev->ofdev.node, "name", NULL); | ||
236 | return sprintf(buf, "%s\n", name); | ||
237 | } | 239 | } |
238 | 240 | ||
239 | static struct device_attribute ibmebus_dev_attrs[] = { | 241 | static struct device_attribute ibmebus_dev_attrs[] = { |