/* * Prevent a kernel oops in vsnprintf() -- it only allows passing a * NULL ptr when the length is also 0. Also filter out the negative * lengths...
*/ if ((len > 0 && !str) || len < 0) return -EINVAL;
/* 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; if (csize >= len)
csize = len > 0 ? len - 1 : 0;
len -= csize;
str += csize;
of_property_for_each_string(np, "compatible", p, compat) {
csize = snprintf(str, len, "C%s", compat);
tsize += csize; if (csize >= len) continue; for (c = str; c; ) {
c = strchr(c, ' '); if (c)
*c++ = '_';
}
len -= csize;
str += csize;
}
return tsize;
}
int of_request_module(conststruct device_node *np)
{ char *str;
ssize_t size; int ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.