Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/greybus: Use kobj_to_dev()

Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@vivo.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/1597289690-22857-1-git-send-email-wangqing@vivo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wang Qing and committed by
Greg Kroah-Hartman
947bece1 99f66735

+3 -3
+3 -3
drivers/greybus/interface.c
··· 620 620 static umode_t interface_unipro_is_visible(struct kobject *kobj, 621 621 struct attribute *attr, int n) 622 622 { 623 - struct device *dev = container_of(kobj, struct device, kobj); 623 + struct device *dev = kobj_to_dev(kobj); 624 624 struct gb_interface *intf = to_gb_interface(dev); 625 625 626 626 switch (intf->type) { ··· 635 635 static umode_t interface_greybus_is_visible(struct kobject *kobj, 636 636 struct attribute *attr, int n) 637 637 { 638 - struct device *dev = container_of(kobj, struct device, kobj); 638 + struct device *dev = kobj_to_dev(kobj); 639 639 struct gb_interface *intf = to_gb_interface(dev); 640 640 641 641 switch (intf->type) { ··· 649 649 static umode_t interface_power_is_visible(struct kobject *kobj, 650 650 struct attribute *attr, int n) 651 651 { 652 - struct device *dev = container_of(kobj, struct device, kobj); 652 + struct device *dev = kobj_to_dev(kobj); 653 653 struct gb_interface *intf = to_gb_interface(dev); 654 654 655 655 switch (intf->type) {