Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198034
b: refs/heads/master
c: 44504b2
h: refs/heads/master
v: v3
  • Loading branch information
Grant Likely committed May 22, 2010
1 parent 489fa69 commit e45b801
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 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: 4018294b53d1dae026880e45f174c1cc63b5d435
refs/heads/master: 44504b2bebf8b5823c59484e73096a7d6574471d
5 changes: 2 additions & 3 deletions trunk/drivers/macintosh/macio_asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ 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);
const struct of_device_id * matches = drv->of_match_table;

if (!matches)
return 0;

return of_match_device(matches, &macio_dev->ofdev) != NULL;
return of_match_device(matches, dev) != NULL;
}

struct macio_dev *macio_dev_get(struct macio_dev *dev)
Expand Down Expand Up @@ -83,7 +82,7 @@ static int macio_device_probe(struct device *dev)

macio_dev_get(macio_dev);

match = of_match_device(drv->driver.of_match_table, &macio_dev->ofdev);
match = of_match_device(drv->driver.of_match_table, dev);
if (match)
error = drv->probe(macio_dev, match);
if (error)
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/of/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@
#include <asm/errno.h>

/**
* of_match_device - Tell if an of_device structure has a matching
* of_match structure
* of_match_device - Tell if a struct device matches an of_device_id list
* @ids: array of of device match structures to search in
* @dev: the of device structure to match against
*
* Used by a driver to check whether an of_device present in the
* system is in its list of supported devices.
*/
const struct of_device_id *of_match_device(const struct of_device_id *matches,
const struct of_device *dev)
const struct device *dev)
{
if (!dev->dev.of_node)
if (!dev->of_node)
return NULL;
return of_match_node(matches, dev->dev.of_node);
return of_match_node(matches, dev->of_node);
}
EXPORT_SYMBOL(of_match_device);

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ 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);
const struct of_device_id *matches = drv->of_match_table;

if (!matches)
return 0;

return of_match_device(matches, of_dev) != NULL;
return of_match_device(matches, dev) != NULL;
}

static int of_platform_device_probe(struct device *dev)
Expand All @@ -45,7 +44,7 @@ static int of_platform_device_probe(struct device *dev)

of_dev_get(of_dev);

match = of_match_device(drv->driver.of_match_table, of_dev);
match = of_match_device(drv->driver.of_match_table, dev);
if (match)
error = drv->probe(of_dev, match);
if (error)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/of_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define to_of_device(d) container_of(d, struct of_device, dev)

extern const struct of_device_id *of_match_device(
const struct of_device_id *matches, const struct of_device *dev);
const struct of_device_id *matches, const struct device *dev);

extern struct of_device *of_dev_get(struct of_device *dev);
extern void of_dev_put(struct of_device *dev);
Expand Down

0 comments on commit e45b801

Please sign in to comment.