linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/greybus: Use kobj_to_dev() instead
@ 2020-08-13  3:34 Wang Qing
  2020-08-17  6:11 ` [greybus-dev] " Viresh Kumar
  2020-08-17 10:08 ` Johan Hovold
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Qing @ 2020-08-13  3:34 UTC (permalink / raw)
  To: Johan Hovold, Alex Elder, Greg Kroah-Hartman, greybus-dev, linux-kernel
  Cc: Wang Qing

Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/greybus/interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/greybus/interface.c b/drivers/greybus/interface.c
index 67dbe6f..de167f1
--- 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) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [greybus-dev] [PATCH] drivers/greybus: Use kobj_to_dev() instead
  2020-08-13  3:34 [PATCH] drivers/greybus: Use kobj_to_dev() instead Wang Qing
@ 2020-08-17  6:11 ` Viresh Kumar
  2020-08-17 10:08 ` Johan Hovold
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2020-08-17  6:11 UTC (permalink / raw)
  To: Wang Qing
  Cc: Johan Hovold, Alex Elder, Greg Kroah-Hartman, greybus-dev, linux-kernel

On 13-08-20, 11:34, Wang Qing wrote:
> Use kobj_to_dev() instead of container_of()
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>
> ---
>  drivers/greybus/interface.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drivers/greybus: Use kobj_to_dev() instead
  2020-08-13  3:34 [PATCH] drivers/greybus: Use kobj_to_dev() instead Wang Qing
  2020-08-17  6:11 ` [greybus-dev] " Viresh Kumar
@ 2020-08-17 10:08 ` Johan Hovold
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2020-08-17 10:08 UTC (permalink / raw)
  To: Wang Qing
  Cc: Johan Hovold, Alex Elder, Greg Kroah-Hartman, greybus-dev, linux-kernel

On Thu, Aug 13, 2020 at 11:34:48AM +0800, Wang Qing wrote:
> Use kobj_to_dev() instead of container_of()
> 
> Signed-off-by: Wang Qing <wangqing@vivo.com>

I'd shorten the summary somewhat:

	greybus: use kobj_to_dev()

but looks good otherwise.

Acked-by: Johan Hovold <johan@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-17 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13  3:34 [PATCH] drivers/greybus: Use kobj_to_dev() instead Wang Qing
2020-08-17  6:11 ` [greybus-dev] " Viresh Kumar
2020-08-17 10:08 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).