drivers/greybus: Use kobj_to_dev() instead
PATCH 1/1 drivers/greybus: Use kobj_to_dev() instead
Use kobj_to_dev() instead of container_of()
Signed-off-by Wang Qing <[email protected]>
--- drivers/greybus/interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/greybus/interface.c +3 -3
@@ -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) {
Signature · 1 line
2.7.4
Quoted 6 lines · Wang Qing
Use
kobj_to_dev()instead ofcontainer_of()Signed-off-by Wang Qing <[email protected]>--- drivers/greybus/interface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Acked-by Viresh Kumar <[email protected]>
Signature · 1 line
viresh
Quoted 3 lines · Wang Qing
Use
kobj_to_dev()instead ofcontainer_of()Signed-off-by Wang Qing <[email protected]>
I'd shorten the summary somewhat:
greybus: use kobj_to_dev()
but looks good otherwise.
Acked-by Johan Hovold <[email protected]>