From: Wang Qing Date: Thu, 13 Aug 2020 03:34:48 +0000 (+0800) Subject: drivers/greybus: Use kobj_to_dev() X-Git-Tag: v5.10.7~1418^2~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=947bece14b741ed339eda14db42cf3c357183501;p=platform%2Fkernel%2Flinux-rpi.git drivers/greybus: Use kobj_to_dev() Use kobj_to_dev() instead of container_of() Signed-off-by: Wang Qing Acked-by: Viresh Kumar Acked-by: Johan Hovold Link: https://lore.kernel.org/r/1597289690-22857-1-git-send-email-wangqing@vivo.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/greybus/interface.c b/drivers/greybus/interface.c index 58ea374..9ec949a 100644 --- a/drivers/greybus/interface.c +++ b/drivers/greybus/interface.c @@ -620,7 +620,7 @@ static struct attribute *interface_common_attrs[] = { static umode_t interface_unipro_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gb_interface *intf = to_gb_interface(dev); switch (intf->type) { @@ -635,7 +635,7 @@ static umode_t interface_unipro_is_visible(struct kobject *kobj, static umode_t interface_greybus_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gb_interface *intf = to_gb_interface(dev); switch (intf->type) { @@ -649,7 +649,7 @@ static umode_t interface_greybus_is_visible(struct kobject *kobj, static umode_t interface_power_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gb_interface *intf = to_gb_interface(dev); switch (intf->type) {