linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers/thermal: Use kobj_to_dev() instead
@ 2020-06-15  9:07 Wang Qing
  2020-06-23 12:45 ` Amit Kucheria
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Qing @ 2020-06-15  9:07 UTC (permalink / raw)
  To: Zhang Rui, Daniel Lezcano, Amit Kucheria, linux-pm, linux-kernel
  Cc: Wang Qing

Use kobj_to_dev() instead of container_of()

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/thermal/thermal_sysfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 drivers/thermal/thermal_sysfs.c

diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index aa99edb..3e92ff9
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -438,7 +438,7 @@ static umode_t thermal_zone_mode_is_visible(struct kobject *kobj,
 					    struct attribute *attr,
 					    int attrno)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct thermal_zone_device *tz;
 
 	tz = container_of(dev, struct thermal_zone_device, device);
@@ -464,7 +464,7 @@ static umode_t thermal_zone_passive_is_visible(struct kobject *kobj,
 					       struct attribute *attr,
 					       int attrno)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct thermal_zone_device *tz;
 	enum thermal_trip_type trip_type;
 	int count, passive = 0;
-- 
2.7.4


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

* Re: [PATCH] drivers/thermal: Use kobj_to_dev() instead
  2020-06-15  9:07 [PATCH] drivers/thermal: Use kobj_to_dev() instead Wang Qing
@ 2020-06-23 12:45 ` Amit Kucheria
  0 siblings, 0 replies; 2+ messages in thread
From: Amit Kucheria @ 2020-06-23 12:45 UTC (permalink / raw)
  To: Wang Qing; +Cc: Zhang Rui, Daniel Lezcano, Linux PM list, LKML

On Mon, Jun 15, 2020 at 2:37 PM Wang Qing <wangqing@vivo.com> wrote:
>
> Use kobj_to_dev() instead of container_of()
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>

Acked-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/thermal_sysfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 drivers/thermal/thermal_sysfs.c
>
> diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
> index aa99edb..3e92ff9
> --- a/drivers/thermal/thermal_sysfs.c
> +++ b/drivers/thermal/thermal_sysfs.c
> @@ -438,7 +438,7 @@ static umode_t thermal_zone_mode_is_visible(struct kobject *kobj,
>                                             struct attribute *attr,
>                                             int attrno)
>  {
> -       struct device *dev = container_of(kobj, struct device, kobj);
> +       struct device *dev = kobj_to_dev(kobj);
>         struct thermal_zone_device *tz;
>
>         tz = container_of(dev, struct thermal_zone_device, device);
> @@ -464,7 +464,7 @@ static umode_t thermal_zone_passive_is_visible(struct kobject *kobj,
>                                                struct attribute *attr,
>                                                int attrno)
>  {
> -       struct device *dev = container_of(kobj, struct device, kobj);
> +       struct device *dev = kobj_to_dev(kobj);
>         struct thermal_zone_device *tz;
>         enum thermal_trip_type trip_type;
>         int count, passive = 0;
> --
> 2.7.4
>

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

end of thread, other threads:[~2020-06-23 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15  9:07 [PATCH] drivers/thermal: Use kobj_to_dev() instead Wang Qing
2020-06-23 12:45 ` Amit Kucheria

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).