Re: [PATCH 2/3] thermal: hwmon: Remove redundant OOM message

From: Daniel Lezcano

Date: Thu Aug 20 2026 - 17:31:04 EST


On 8/12/26 06:28, phucduc.bui@xxxxxxxxx wrote:
From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Remove the dev_warn() after a failed devres_alloc(). This is
consistent with checkpatch's OOM_MESSAGE convention: no error
message is needed after a kzalloc()-style allocation failure.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/thermal/thermal_hwmon.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index ec73d03a1e60..747ac87d1c37 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -269,10 +269,8 @@ int devm_thermal_add_hwmon_sysfs(struct device *dev, struct thermal_zone_device
ptr = devres_alloc(devm_thermal_hwmon_release, sizeof(*ptr),
GFP_KERNEL);
- if (!ptr) {
- dev_warn(dev, "Failed to allocate device resource data\n");
+ if (!ptr)
return -ENOMEM;
- }
Acked-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>