Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney...
[pandora-kernel.git] / arch / powerpc / kernel / of_device.c
index 3388ad6..e9be908 100644 (file)
@@ -5,10 +5,10 @@
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
 #include <linux/slab.h>
+#include <linux/of_device.h>
 
 #include <asm/errno.h>
 #include <asm/dcr.h>
-#include <asm/of_device.h>
 
 static void of_device_make_bus_id(struct of_device *dev)
 {
@@ -89,54 +89,6 @@ struct of_device *of_device_alloc(struct device_node *np,
 }
 EXPORT_SYMBOL(of_device_alloc);
 
-ssize_t of_device_get_modalias(struct of_device *ofdev,
-                               char *str, ssize_t len)
-{
-       const char *compat;
-       int cplen, i;
-       ssize_t tsize, csize, repend;
-
-       /* Name & Type */
-       csize = snprintf(str, len, "of:N%sT%s",
-                               ofdev->node->name, ofdev->node->type);
-
-       /* Get compatible property if any */
-       compat = of_get_property(ofdev->node, "compatible", &cplen);
-       if (!compat)
-               return csize;
-
-       /* Find true end (we tolerate multiple \0 at the end */
-       for (i=(cplen-1); i>=0 && !compat[i]; i--)
-               cplen--;
-       if (!cplen)
-               return csize;
-       cplen++;
-
-       /* Check space (need cplen+1 chars including final \0) */
-       tsize = csize + cplen;
-       repend = tsize;
-
-       if (csize>=len)         /* @ the limit, all is already filled */
-               return tsize;
-
-       if (tsize>=len) {               /* limit compat list */
-               cplen = len-csize-1;
-               repend = len;
-       }
-
-       /* Copy and do char replacement */
-       memcpy(&str[csize+1], compat, cplen);
-       for (i=csize; i<repend; i++) {
-               char c = str[i];
-               if (c=='\0')
-                       str[i] = 'C';
-               else if (c==' ')
-                       str[i] = '_';
-       }
-
-       return tsize;
-}
-
 int of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        struct of_device *ofdev;