/* * mdev_register_parent: Register a device as parent for mdevs * @parent: parent structure registered * @dev: device structure representing parent device. * @mdev_driver: Device driver to bind to the newly created mdev * @types: Array of supported mdev types * @nr_types: Number of entries in @types * * Registers the @parent stucture as a parent for mdev types and thus mdev * devices. The caller needs to hold a reference on @dev that must not be * released until after the call to mdev_unregister_parent(). * * Returns a negative value on error, otherwise 0.
*/ int mdev_register_parent(struct mdev_parent *parent, struct device *dev, struct mdev_driver *mdev_driver, struct mdev_type **types, unsignedint nr_types)
{ char *env_string = "MDEV_STATE=registered"; char *envp[] = { env_string, NULL }; int ret;
/* Check for duplicate */
list_for_each_entry(tmp, &mdev_list, next) { if (guid_equal(&tmp->uuid, uuid)) {
mutex_unlock(&mdev_list_lock); return -EEXIST;
}
}
if (!drv->get_available) { /* * Note: that non-atomic read and dec is fine here because * all modifications are under mdev_list_lock.
*/ if (!atomic_read(&parent->available_instances)) {
mutex_unlock(&mdev_list_lock); return -EUSERS;
}
atomic_dec(&parent->available_instances);
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.11Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-06-07)
¤
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.