#include <linux/usb/role.h>
#include <linux/property.h>
#include <linux/device.h>
+#include <linux/lockdep.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/slab.h>
usb_role_switch_set_t set;
usb_role_switch_get_t get;
bool allow_userspace_control;
+
+ struct lock_class_key key;
};
#define to_role_switch(d) container_of(d, struct usb_role_switch, dev)
sw->registered = true;
+ lockdep_register_key(&sw->key);
+ lockdep_set_class(&sw->lock, &sw->key);
+
/* TODO: Symlinks for the host port and the device controller. */
return sw;
{
if (IS_ERR_OR_NULL(sw))
return;
+
+ lockdep_unregister_key(&sw->key);
+
sw->registered = false;
if (dev_fwnode(&sw->dev))
component_del(&sw->dev, &connector_ops);