[PATCH 2/3] thermal: hwmon: Remove redundant OOM message
| Newsgroups | org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel,org.kernel.vger.linux-usb |
|---|---|
| Message-ID | <[email protected]> |
From: bui duc phuc <[email protected]> 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 <[email protected]> --- 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; - } ret = thermal_add_hwmon_sysfs(tz); if (ret) { -- 2.43.0