]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ppc64/kernel/of_device.c
Merge gregkh@master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
[linux-2.6-omap-h63xx.git] / arch / ppc64 / kernel / of_device.c
index 66bd5ab7c25a4f17a3d95430fcc790c68e2c6360..da580812ddfeeb6305b8604c03ae6867ade531af 100644 (file)
@@ -3,6 +3,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <asm/errno.h>
 #include <asm/of_device.h>
 
  * Used by a driver to check whether an of_device present in the
  * system is in its list of supported devices.
  */
-const struct of_match * of_match_device(const struct of_match *matches,
+const struct of_device_id *of_match_device(const struct of_device_id *matches,
                                        const struct of_device *dev)
 {
        if (!dev->node)
                return NULL;
-       while (matches->name || matches->type || matches->compatible) {
+       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
                int match = 1;
-               if (matches->name && matches->name != OF_ANY_MATCH)
+               if (matches->name[0])
                        match &= dev->node->name
                                && !strcmp(matches->name, dev->node->name);
-               if (matches->type && matches->type != OF_ANY_MATCH)
+               if (matches->type[0])
                        match &= dev->node->type
                                && !strcmp(matches->type, dev->node->type);
-               if (matches->compatible && matches->compatible != OF_ANY_MATCH)
+               if (matches->compatible[0])
                        match &= device_is_compatible(dev->node,
                                matches->compatible);
                if (match)
@@ -42,7 +43,7 @@ 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_match * matches = of_drv->match_table;
+       const struct of_device_id * matches = of_drv->match_table;
 
        if (!matches)
                return 0;
@@ -75,7 +76,7 @@ static int of_device_probe(struct device *dev)
        int error = -ENODEV;
        struct of_platform_driver *drv;
        struct of_device *of_dev;
-       const struct of_match *match;
+       const struct of_device_id *match;
 
        drv = to_of_platform_driver(dev->driver);
        of_dev = to_of_device(dev);
@@ -235,7 +236,6 @@ void of_device_unregister(struct of_device *ofdev)
 struct of_device* of_platform_device_create(struct device_node *np, const char *bus_id)
 {
        struct of_device *dev;
-       u32 *reg;
 
        dev = kmalloc(sizeof(*dev), GFP_KERNEL);
        if (!dev)
@@ -249,7 +249,6 @@ struct of_device* of_platform_device_create(struct device_node *np, const char *
        dev->dev.bus = &of_platform_bus_type;
        dev->dev.release = of_release_dev;
 
-       reg = (u32 *)get_property(np, "reg", NULL);
        strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
 
        if (of_device_register(dev) != 0) {