of: Move of_modalias() to module.c
[platform/kernel/linux-starfive.git] / drivers / of / device.c
index 351c505..7183cfd 100644 (file)
@@ -1,5 +1,4 @@
 // SPDX-License-Identifier: GPL-2.0
-#include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -248,42 +247,6 @@ const void *of_device_get_match_data(const struct device *dev)
 }
 EXPORT_SYMBOL(of_device_get_match_data);
 
-static ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len)
-{
-       const char *compat;
-       char *c;
-       struct property *p;
-       ssize_t csize;
-       ssize_t tsize;
-
-       /* Name & Type */
-       /* %p eats all alphanum characters, so %c must be used here */
-       csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T',
-                        of_node_get_device_type(np));
-       tsize = csize;
-       len -= csize;
-       if (str)
-               str += csize;
-
-       of_property_for_each_string(np, "compatible", p, compat) {
-               csize = strlen(compat) + 1;
-               tsize += csize;
-               if (csize > len)
-                       continue;
-
-               csize = snprintf(str, len, "C%s", compat);
-               for (c = str; c; ) {
-                       c = strchr(c, ' ');
-                       if (c)
-                               *c++ = '_';
-               }
-               len -= csize;
-               str += csize;
-       }
-
-       return tsize;
-}
-
 int of_device_request_module(struct device *dev)
 {
        char *str;