From: Marc Zyngier <marc.zyngier@arm.com>
To: Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info
Date: Tue, 10 Jul 2018 16:40:35 +0100 [thread overview]
Message-ID: <20180710154035.26828-3-marc.zyngier@arm.com> (raw)
In-Reply-To: <20180710154035.26828-1-marc.zyngier@arm.com>
When registering the hwmon device, we pass NULL as the device.
While this doesn't result in any immediate breakage, it leaves
the hwmon device at the root of the virtual devices, rather than
attached to the thermal zone hierarchy.
Instead, let's pass the actual device, which is part of the
thermal_zone_device structure. This also avoids the rather
unpleasant ""NULL device *" which can be generated by dev_{err,info}
in the hwmon subsystem.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
drivers/thermal/thermal_hwmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index 0bd47007c57f..40c69a533b24 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -143,7 +143,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
INIT_LIST_HEAD(&hwmon->tz_list);
strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
strreplace(hwmon->type, '-', '_');
- hwmon->device = hwmon_device_register_with_info(NULL, hwmon->type,
+ hwmon->device = hwmon_device_register_with_info(&tz->device, hwmon->type,
hwmon, NULL, NULL);
if (IS_ERR(hwmon->device)) {
result = PTR_ERR(hwmon->device);
--
2.18.0
next prev parent reply other threads:[~2018-07-10 15:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 15:40 [PATCH 0/2] Minor thermal_hwmon cleanups Marc Zyngier
2018-07-10 15:40 ` [PATCH 1/2] thermal_hwmon: Sanitize attribute name passed to hwmon Marc Zyngier
2018-07-18 9:42 ` Enric Balletbo Serra
2018-07-10 15:40 ` Marc Zyngier [this message]
2018-07-18 9:43 ` [PATCH 2/2] thermal_hwmon: Pass the originating device down to hwmon_device_register_with_info Enric Balletbo Serra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710154035.26828-3-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®