diff options
Diffstat (limited to 'drivers/of/module.c')
-rw-r--r-- | drivers/of/module.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/of/module.c b/drivers/of/module.c index 780fd82a7ecc..1e735fc130ad 100644 --- a/drivers/of/module.c +++ b/drivers/of/module.c @@ -35,12 +35,10 @@ ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len) str += csize; of_property_for_each_string(np, "compatible", p, compat) { - csize = strlen(compat) + 1; + csize = snprintf(str, len, "C%s", compat); tsize += csize; if (csize >= len) continue; - - csize = snprintf(str, len, "C%s", compat); for (c = str; c; ) { c = strchr(c, ' '); if (c) |