* (no subject)
@ 2017-12-07 21:32 Paul Marques Mota
2017-12-07 23:34 ` your mail Guenter Roeck
0 siblings, 1 reply; 3+ messages in thread
From: Paul Marques Mota @ 2017-12-07 21:32 UTC (permalink / raw)
To: linux-hwmon
From: Paul Marques Mota <paul@marquesmota.pt>
To: HARDWARE MONITORING <linux-hwmon@vger.kernel.org>
Date: Thu, 7 Dec 2017 20:04:22 +0000
Subject: [PATCH] add stack trace to deprecated hwmon_device_register()
Hi,
hwmon_device_register() in drivers/hwmon/hwmon.c prints the unhelpful
message below on my machine:
(NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
Therefore, this patch dumps the stack at that point. In my case it is
then obvious in the resulting dmesg, available at
http://www.marquesmota.pt/dmesg.txt
that thermal_add_hwmon_sysfs() in drivers/thermal/thermal_hwmon.c needs
to be converted to the new API.
This patch is against 4.15.0-rc2
I believe it is also needed in Bugzilla bug #195843
https://bugzilla.kernel.org/show_bug.cgi?id=195843
Signed-off-by: Paul Marques Mota<paul@marquesmota.pt>
---
drivers/hwmon/hwmon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index c9790e2c3440..31719ce4a681 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -702,6 +702,7 @@ struct device *hwmon_device_register(struct device *dev)
{
dev_warn(dev,
"hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().\n");
+ dump_stack();
return __hwmon_device_register(dev, NULL, NULL, NULL, NULL);
}
--
2.15.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: your mail
2017-12-07 21:32 Paul Marques Mota
@ 2017-12-07 23:34 ` Guenter Roeck
2017-12-07 23:38 ` Paul Marques Mota
0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2017-12-07 23:34 UTC (permalink / raw)
To: Paul Marques Mota; +Cc: linux-hwmon
On Thu, Dec 07, 2017 at 09:32:01PM +0000, Paul Marques Mota wrote:
> From: Paul Marques Mota <paul@marquesmota.pt>
> To: HARDWARE MONITORING <linux-hwmon@vger.kernel.org>
> Date: Thu, 7 Dec 2017 20:04:22 +0000
> Subject: [PATCH] add stack trace to deprecated hwmon_device_register()
>
> Hi,
>
> hwmon_device_register() in drivers/hwmon/hwmon.c prints the unhelpful
> message below on my machine:
>
> (NULL device *): hwmon_device_register() is deprecated. Please convert the driver to use hwmon_device_register_with_info().
>
> Therefore, this patch dumps the stack at that point. In my case it is
> then obvious in the resulting dmesg, available at
>
> http://www.marquesmota.pt/dmesg.txt
>
> that thermal_add_hwmon_sysfs() in drivers/thermal/thermal_hwmon.c needs
> to be converted to the new API.
>
> This patch is against 4.15.0-rc2
> I believe it is also needed in Bugzilla bug #195843
> https://bugzilla.kernel.org/show_bug.cgi?id=195843
>
> Signed-off-by: Paul Marques Mota<paul@marquesmota.pt>
Nack, this is not needed. The thermal subsystem is the only subsystem
which doesn't pass a device pointer, and I don't want to have logs
clogged up with unnecessary tracebacks because of it.
If it wasn't for thermal, I would actually let hwmon registrations with
NULL device pointer fail completely. Unfortunately there is no easy way
to convert the thermal subsystem to use hwmon_device_register_with_info(),
since even though thermal_zone_device_register() registers a thermal zone
device, it does not have a notion of 'struct device *'.
Maybe someone can step in and convert the thermal code to use
hwmon_device_register_with_groups(). That doesn't really solve the problem,
but at least the symptom would be gone, and the thermal code would be
a little cleaner.
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-07 23:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 21:32 Paul Marques Mota
2017-12-07 23:34 ` your mail Guenter Roeck
2017-12-07 23:38 ` Paul Marques Mota
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.