Skip to content

Commit

Permalink
drivers/greybus: Use kobj_to_dev()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Qing authored and Greg Kroah-Hartman committed Sep 4, 2020
1 parent 99f6673 commit 947bece
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/greybus/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 947bece

Please sign in to comment.