Skip to content

Commit 947bece

Browse files
Wang Qinggregkh
authored andcommitted
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>
1 parent 99f6673 commit 947bece

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/greybus/interface.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static struct attribute *interface_common_attrs[] = {
620620
static umode_t interface_unipro_is_visible(struct kobject *kobj,
621621
struct attribute *attr, int n)
622622
{
623-
struct device *dev = container_of(kobj, struct device, kobj);
623+
struct device *dev = kobj_to_dev(kobj);
624624
struct gb_interface *intf = to_gb_interface(dev);
625625

626626
switch (intf->type) {
@@ -635,7 +635,7 @@ static umode_t interface_unipro_is_visible(struct kobject *kobj,
635635
static umode_t interface_greybus_is_visible(struct kobject *kobj,
636636
struct attribute *attr, int n)
637637
{
638-
struct device *dev = container_of(kobj, struct device, kobj);
638+
struct device *dev = kobj_to_dev(kobj);
639639
struct gb_interface *intf = to_gb_interface(dev);
640640

641641
switch (intf->type) {
@@ -649,7 +649,7 @@ static umode_t interface_greybus_is_visible(struct kobject *kobj,
649649
static umode_t interface_power_is_visible(struct kobject *kobj,
650650
struct attribute *attr, int n)
651651
{
652-
struct device *dev = container_of(kobj, struct device, kobj);
652+
struct device *dev = kobj_to_dev(kobj);
653653
struct gb_interface *intf = to_gb_interface(dev);
654654

655655
switch (intf->type) {

0 commit comments

Comments
 (0)