aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:13:01 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:10:40 -0400
commit597b9d1e44e9ba69f2454a5318bbe7a6d5e6930a (patch)
tree373f1f1387143b0ea8811ca6e2a6812f0a86d933 /arch
parent173b3a7a059a6998a6c0733710818c473cc0de4c (diff)
drivercore: Add of_match_table to the common device drivers
OF-style matching can be available to any device, on any type of bus. This patch allows any driver to provide an OF match table when CONFIG_OF is enabled so that drivers can be bound against devices described in the device tree. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/ibmebus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index a9f31631a293..355257bb149d 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -201,8 +201,11 @@ static int ibmebus_create_devices(const struct of_device_id *matches)
201 201
202int ibmebus_register_driver(struct of_platform_driver *drv) 202int ibmebus_register_driver(struct of_platform_driver *drv)
203{ 203{
204 if (!drv->driver.of_match_table)
205 drv->driver.of_match_table = drv->match_table;
206
204 /* If the driver uses devices that ibmebus doesn't know, add them */ 207 /* If the driver uses devices that ibmebus doesn't know, add them */
205 ibmebus_create_devices(drv->match_table); 208 ibmebus_create_devices(drv->driver.of_match_table);
206 209
207 return of_register_driver(drv, &ibmebus_bus_type); 210 return of_register_driver(drv, &ibmebus_bus_type);
208} 211}