diff mbox series

thermal: Use kobj_to_dev() instead of container_of()

Message ID 1597799671-11530-1-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series thermal: Use kobj_to_dev() instead of container_of() | expand

Commit Message

tiantao (H) Aug. 19, 2020, 1:14 a.m. UTC
Use kobj_to_dev() instead of container_of()

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/thermal/thermal_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Lezcano Aug. 24, 2020, 10:24 a.m. UTC | #1
On 19/08/2020 03:14, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 8c23121..a6f371f 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -448,7 +448,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;