1 // SPDX-License-Identifier: GPL-2.0
3 * Linux kernel module helpers.
7 #include <linux/slab.h>
8 #include <linux/string.h>
10 ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len)
19 /* %p eats all alphanum characters, so %c must be used here */
20 csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T',
21 of_node_get_device_type(np));
27 of_property_for_each_string(np, "compatible", p, compat) {
28 csize = strlen(compat) + 1;
33 csize = snprintf(str, len, "C%s", compat);