ATTRIBUTE_GROUPS(interface);
-/* XXX This could be per-host device */
-static DEFINE_SPINLOCK(gb_interfaces_lock);
-
// FIXME, odds are you don't want to call this function, rework the caller to
// not need it please.
struct gb_interface *gb_interface_find(struct gb_host_device *hd,
*
* Returns a pointer to the new interfce or a null pointer if a
* failure occurs due to memory exhaustion.
+ *
+ * Locking: Caller ensures serialisation with gb_interface_remove and
+ * gb_interface_find.
*/
struct gb_interface *gb_interface_create(struct gb_host_device *hd,
u8 interface_id)
return NULL;
}
- spin_lock_irq(&gb_interfaces_lock);
list_add(&intf->links, &hd->interfaces);
- spin_unlock_irq(&gb_interfaces_lock);
return intf;
}
gb_control_disable(intf->control);
- spin_lock_irq(&gb_interfaces_lock);
list_del(&intf->links);
- spin_unlock_irq(&gb_interfaces_lock);
put_device(&intf->dev);
}