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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ca065bf127
commit
0616ca73fd
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user