[<prev] [next>] [day] [month] [year] [list]
Message-ID: <250aa766-6be2-bc11-1d16-7e6b2b369169@users.sourceforge.net>
Date: Sun, 17 Dec 2017 21:15:46 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-pm@...r.kernel.org, Sebastian Reichel <sre@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH] generic-adc-battery: Delete an error message for a failed
memory allocation in gab_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Sun, 17 Dec 2017 21:10:51 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/power/supply/generic-adc-battery.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
index 28dc056eaafa..bac71719091a 100644
--- a/drivers/power/supply/generic-adc-battery.c
+++ b/drivers/power/supply/generic-adc-battery.c
@@ -247,10 +247,8 @@ static int gab_probe(struct platform_device *pdev)
int index = 0;
adc_bat = devm_kzalloc(&pdev->dev, sizeof(*adc_bat), GFP_KERNEL);
- if (!adc_bat) {
- dev_err(&pdev->dev, "failed to allocate memory\n");
+ if (!adc_bat)
return -ENOMEM;
- }
psy_cfg.drv_data = adc_bat;
psy_desc = &adc_bat->psy_desc;
--
2.15.1
Powered by blists - more mailing lists