Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198032
b: refs/heads/master
c: 597b9d1
h: refs/heads/master
v: v3
  • Loading branch information
Grant Likely committed May 22, 2010
1 parent 7db3883 commit 85e7dbb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 173b3a7a059a6998a6c0733710818c473cc0de4c
refs/heads/master: 597b9d1e44e9ba69f2454a5318bbe7a6d5e6930a
5 changes: 4 additions & 1 deletion trunk/arch/powerpc/kernel/ibmebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ static int ibmebus_create_devices(const struct of_device_id *matches)

int ibmebus_register_driver(struct of_platform_driver *drv)
{
if (!drv->driver.of_match_table)
drv->driver.of_match_table = drv->match_table;

/* If the driver uses devices that ibmebus doesn't know, add them */
ibmebus_create_devices(drv->match_table);
ibmebus_create_devices(drv->driver.of_match_table);

return of_register_driver(drv, &ibmebus_bus_type);
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/macintosh/macio_asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ static struct macio_chip *macio_on_hold;
static int macio_bus_match(struct device *dev, struct device_driver *drv)
{
struct macio_dev * macio_dev = to_macio_device(dev);
struct macio_driver * macio_drv = to_macio_driver(drv);
const struct of_device_id * matches = macio_drv->match_table;
const struct of_device_id * matches = drv->of_match_table;

if (!matches)
return 0;
Expand Down Expand Up @@ -84,7 +83,7 @@ static int macio_device_probe(struct device *dev)

macio_dev_get(macio_dev);

match = of_match_device(drv->match_table, &macio_dev->ofdev);
match = of_match_device(drv->driver.of_match_table, &macio_dev->ofdev);
if (match)
error = drv->probe(macio_dev, match);
if (error)
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ extern struct device_attribute of_platform_device_attrs[];
static int of_platform_bus_match(struct device *dev, struct device_driver *drv)
{
struct of_device *of_dev = to_of_device(dev);
struct of_platform_driver *of_drv = to_of_platform_driver(drv);
const struct of_device_id *matches = of_drv->match_table;
const struct of_device_id *matches = drv->of_match_table;

if (!matches)
return 0;
Expand All @@ -46,7 +45,7 @@ static int of_platform_device_probe(struct device *dev)

of_dev_get(of_dev);

match = of_match_device(drv->match_table, of_dev);
match = of_match_device(drv->driver.of_match_table, of_dev);
if (match)
error = drv->probe(of_dev, match);
if (error)
Expand Down Expand Up @@ -391,6 +390,8 @@ int of_register_driver(struct of_platform_driver *drv, struct bus_type *bus)
drv->driver.name = drv->name;
if (!drv->driver.owner)
drv->driver.owner = drv->owner;
if (!drv->driver.of_match_table)
drv->driver.of_match_table = drv->match_table;
drv->driver.bus = bus;

/* register with core */
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ struct device_driver {

bool suppress_bind_attrs; /* disables bind/unbind via sysfs */

#if defined(CONFIG_OF)
const struct of_device_id *of_match_table;
#endif

int (*probe) (struct device *dev);
int (*remove) (struct device *dev);
void (*shutdown) (struct device *dev);
Expand Down

0 comments on commit 85e7dbb

Please sign in to comment.