[PATCH 15/15] w1: gpio: remove unnecessary ENOMEM messages

From: Krzysztof Kozlowski
Date: Sat Apr 15 2023 - 06:44:49 EST


Core already prints detailed reports on out of memory:

WARNING: Possible unnecessary 'out of memory' message

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
drivers/w1/masters/w1-gpio.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index d4632aace402..ac7ad63f8f8d 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -101,10 +101,8 @@ static int w1_gpio_probe(struct platform_device *pdev)

master = devm_kzalloc(dev, sizeof(struct w1_bus_master),
GFP_KERNEL);
- if (!master) {
- dev_err(dev, "Out of memory\n");
+ if (!master)
return -ENOMEM;
- }

pdata->gpiod = devm_gpiod_get_index(dev, NULL, 0, gflags);
if (IS_ERR(pdata->gpiod)) {
--
2.34.1