diff options
Diffstat (limited to 'arch/ppc/syslib/of_device.c')
-rw-r--r-- | arch/ppc/syslib/of_device.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/ppc/syslib/of_device.c b/arch/ppc/syslib/of_device.c index 49c0e34e2d6b..1eb4f726ca9f 100644 --- a/arch/ppc/syslib/of_device.c +++ b/arch/ppc/syslib/of_device.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/mod_devicetable.h> | ||
6 | #include <asm/errno.h> | 7 | #include <asm/errno.h> |
7 | #include <asm/of_device.h> | 8 | #include <asm/of_device.h> |
8 | 9 | ||
@@ -15,20 +16,20 @@ | |||
15 | * Used by a driver to check whether an of_device present in the | 16 | * Used by a driver to check whether an of_device present in the |
16 | * system is in its list of supported devices. | 17 | * system is in its list of supported devices. |
17 | */ | 18 | */ |
18 | const struct of_match * of_match_device(const struct of_match *matches, | 19 | const struct of_device_id * of_match_device(const struct of_device_id *matches, |
19 | const struct of_device *dev) | 20 | const struct of_device *dev) |
20 | { | 21 | { |
21 | if (!dev->node) | 22 | if (!dev->node) |
22 | return NULL; | 23 | return NULL; |
23 | while (matches->name || matches->type || matches->compatible) { | 24 | while (matches->name[0] || matches->type[0] || matches->compatible[0]) { |
24 | int match = 1; | 25 | int match = 1; |
25 | if (matches->name && matches->name != OF_ANY_MATCH) | 26 | if (matches->name[0]) |
26 | match &= dev->node->name | 27 | match &= dev->node->name |
27 | && !strcmp(matches->name, dev->node->name); | 28 | && !strcmp(matches->name, dev->node->name); |
28 | if (matches->type && matches->type != OF_ANY_MATCH) | 29 | if (matches->type[0]) |
29 | match &= dev->node->type | 30 | match &= dev->node->type |
30 | && !strcmp(matches->type, dev->node->type); | 31 | && !strcmp(matches->type, dev->node->type); |
31 | if (matches->compatible && matches->compatible != OF_ANY_MATCH) | 32 | if (matches->compatible[0]) |
32 | match &= device_is_compatible(dev->node, | 33 | match &= device_is_compatible(dev->node, |
33 | matches->compatible); | 34 | matches->compatible); |
34 | if (match) | 35 | if (match) |
@@ -42,7 +43,7 @@ static int of_platform_bus_match(struct device *dev, struct device_driver *drv) | |||
42 | { | 43 | { |
43 | struct of_device * of_dev = to_of_device(dev); | 44 | struct of_device * of_dev = to_of_device(dev); |
44 | struct of_platform_driver * of_drv = to_of_platform_driver(drv); | 45 | struct of_platform_driver * of_drv = to_of_platform_driver(drv); |
45 | const struct of_match * matches = of_drv->match_table; | 46 | const struct of_device_id * matches = of_drv->match_table; |
46 | 47 | ||
47 | if (!matches) | 48 | if (!matches) |
48 | return 0; | 49 | return 0; |
@@ -75,7 +76,7 @@ static int of_device_probe(struct device *dev) | |||
75 | int error = -ENODEV; | 76 | int error = -ENODEV; |
76 | struct of_platform_driver *drv; | 77 | struct of_platform_driver *drv; |
77 | struct of_device *of_dev; | 78 | struct of_device *of_dev; |
78 | const struct of_match *match; | 79 | const struct of_device_id *match; |
79 | 80 | ||
80 | drv = to_of_platform_driver(dev->driver); | 81 | drv = to_of_platform_driver(dev->driver); |
81 | of_dev = to_of_device(dev); | 82 | of_dev = to_of_device(dev); |