[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <42b68c7f-8368-470b-a7b7-d1ff075973fa@roeck-us.net>
Date: Fri, 5 Sep 2025 07:28:42 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Xichao Zhao <zhao.xichao@...o.com>, Jean Delvare <jdelvare@...e.com>,
Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
Lukasz Luba <lukasz.luba@....com>, Guillaume La Roque
<glaroque@...libre.com>, Miquel Raynal <miquel.raynal@...tlin.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>, Markus Mayer <mmayer@...adcom.com>,
Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, zhanghongchen
<zhanghongchen@...ngson.cn>, Yinbo Zhu <zhuyinbo@...ngson.cn>,
Amit Kucheria <amitk@...nel.org>, Thara Gopinath <thara.gopinath@...il.com>,
Niklas Söderlund <niklas.soderlund@...natech.se>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>, Heiko Stuebner <heiko@...ech.de>,
Bartlomiej Zolnierkiewicz <bzolnier@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>, Alim Akhtar
<alim.akhtar@...sung.com>, Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>, Talel Shenhar <talel@...zon.com>,
Eduardo Valentin <edubezval@...il.com>, Keerthy <j-keerthy@...com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
"open list:HARDWARE MONITORING" <linux-hwmon@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:IIO SUBSYSTEM AND DRIVERS" <linux-iio@...r.kernel.org>,
"moderated list:ARM/Allwinner sunXi SoC support"
<linux-arm-kernel@...ts.infradead.org>,
"open list:ARM/Allwinner sunXi SoC support" <linux-sunxi@...ts.linux.dev>,
"open list:THERMAL" <linux-pm@...r.kernel.org>,
"open list:THERMAL DRIVER FOR AMLOGIC SOCS"
<linux-amlogic@...ts.infradead.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@...ts.infradead.org>,
"open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" <imx@...ts.linux.dev>,
"open list:QUALCOMM TSENS THERMAL DRIVER" <linux-arm-msm@...r.kernel.org>,
"open list:RENESAS R-CAR THERMAL DRIVERS"
<linux-renesas-soc@...r.kernel.org>,
"open list:ARM/Rockchip SoC support" <linux-rockchip@...ts.infradead.org>,
"open list:SAMSUNG THERMAL DRIVER" <linux-samsung-soc@...r.kernel.org>,
"moderated list:ARM/STM32 ARCHITECTURE"
<linux-stm32@...md-mailman.stormreply.com>,
"open list:TEGRA ARCHITECTURE SUPPORT" <linux-tegra@...r.kernel.org>,
"open list:TI BANDGAP AND THERMAL DRIVER" <linux-omap@...r.kernel.org>
Subject: Re: [PATCH 01/12] thermal: of: Add error handling in
devm_thermal_*_register()
On 9/5/25 00:23, Xichao Zhao wrote:
> devm_thermal_of_zone_register() does not print any error message
> when registering a thermal zone with a device node sensor fails
> and allocating device resource data fails.
>
> This forces each driver to implement redundant error logging.
> Additionally, when upper-layer functions propagate these errors
> without logging, critical debugging information is lost.
>
> Add dev_err_probe() in devm_thermal_of_zone_register() to unify
> error reporting.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@...o.com>
> ---
> drivers/thermal/thermal_of.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 1a51a4d240ff..8fe0ad402579 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -475,11 +475,15 @@ struct thermal_zone_device *devm_thermal_of_zone_register(struct device *dev, in
>
> ptr = devres_alloc(devm_thermal_of_zone_release, sizeof(*ptr),
> GFP_KERNEL);
> - if (!ptr)
> + if (!ptr) {
> + dev_err(dev, "Failed to allocate device resource data\n");
> return ERR_PTR(-ENOMEM);
> + }
>
> tzd = thermal_of_zone_register(dev->of_node, sensor_id, data, ops);
> if (IS_ERR(tzd)) {
> + dev_err_probe(dev, PTR_ERR(tzd),
> + "Failed to register thermal zone sensor[%d]\n", sensor_id);
This will print an error message even if the problem is (for the calling code,
such as hwmon) only informational.
Guenter
Powered by blists - more mailing lists