error = drv->probe(soundbus_dev); if (error)
soundbus_dev_put(soundbus_dev);
return error;
}
staticint soundbus_uevent(conststruct device *dev, struct kobj_uevent_env *env)
{ conststruct soundbus_dev * soundbus_dev; conststruct platform_device * of; constchar *compat; int retval = 0; int cplen, seen = 0;
if (!dev) return -ENODEV;
soundbus_dev = to_soundbus_device(dev); if (!soundbus_dev) return -ENODEV;
of = &soundbus_dev->ofdev;
/* stuff we want to pass to /sbin/hotplug */
retval = add_uevent_var(env, "OF_NAME=%pOFn", of->dev.of_node); if (retval) return retval;
retval = add_uevent_var(env, "OF_TYPE=%s", of_node_get_device_type(of->dev.of_node)); if (retval) return retval;
/* Since the compatible field can contain pretty much anything * it's not really legal to split it out with commas. We split it
* up using a number of environment variables instead. */
compat = of_get_property(of->dev.of_node, "compatible", &cplen); while (compat && cplen > 0) { int tmp = env->buflen;
retval = add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat); if (retval) return retval;
compat += env->buflen - tmp;
cplen -= env->buflen - tmp;
seen += 1;
}
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.