diff options
author | chenqiwu <chenqiwu@xiaomi.com> | 2020-02-14 20:37:00 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-14 08:38:15 -0800 |
commit | 0616ca73fd35409b0d8d2a17bbca42f6febcd235 (patch) | |
tree | e5851c13f4cdca3d85a88c09b310c515df9ccf4b /drivers/usb/roles | |
parent | ca065bf12771078571dec758300631624edc19a2 (diff) |
usb: use kobj_to_dev() API
Use kobj_to_dev() API instead of container_of().
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Link: https://lore.kernel.org/r/1581683820-9978-1-git-send-email-qiwuchen55@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/roles')
-rw-r--r-- | drivers/usb/roles/class.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c index 63a00ff26655..486b0b1e2a7a 100644 --- a/drivers/usb/roles/class.c +++ b/drivers/usb/roles/class.c @@ -199,7 +199,7 @@ EXPORT_SYMBOL_GPL(usb_role_switch_find_by_fwnode); static umode_t usb_role_switch_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, typeof(*dev), kobj); + struct device *dev = kobj_to_dev(kobj); struct usb_role_switch *sw = to_role_switch(dev); if (sw->allow_userspace_control) |