aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/device.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:13:22 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:10:41 -0400
commit44504b2bebf8b5823c59484e73096a7d6574471d (patch)
treec4d901f026b499f6f0f5c64f4ecbdee297f5db1e /drivers/of/device.c
parent4018294b53d1dae026880e45f174c1cc63b5d435 (diff)
of: change of_match_device to work with struct device
The of_node pointer is now stored directly in struct device, so of_match_device() should work with any device, not just struct of_device. This patch changes the interface to of_match_device() to accept a struct device instead of struct of_device. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r--drivers/of/device.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 24068bbbce1a..7d18f8e0b013 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -10,8 +10,7 @@
10#include <asm/errno.h> 10#include <asm/errno.h>
11 11
12/** 12/**
13 * of_match_device - Tell if an of_device structure has a matching 13 * of_match_device - Tell if a struct device matches an of_device_id list
14 * of_match structure
15 * @ids: array of of device match structures to search in 14 * @ids: array of of device match structures to search in
16 * @dev: the of device structure to match against 15 * @dev: the of device structure to match against
17 * 16 *
@@ -19,11 +18,11 @@
19 * system is in its list of supported devices. 18 * system is in its list of supported devices.
20 */ 19 */
21const struct of_device_id *of_match_device(const struct of_device_id *matches, 20const struct of_device_id *of_match_device(const struct of_device_id *matches,
22 const struct of_device *dev) 21 const struct device *dev)
23{ 22{
24 if (!dev->dev.of_node) 23 if (!dev->of_node)
25 return NULL; 24 return NULL;
26 return of_match_node(matches, dev->dev.of_node); 25 return of_match_node(matches, dev->of_node);
27} 26}
28EXPORT_SYMBOL(of_match_device); 27EXPORT_SYMBOL(of_match_device);
29 28