From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-pm@vger.kernel.org, Sebastian Reichel <sre@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two functions
Date: Sat, 16 Dec 2017 18:43:07 +0000 [thread overview]
Message-ID: <aa138aa9-d8c9-c6e3-7071-9fc642e7b248@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 16 Dec 2017 19:32:02 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/power/supply/tps65090-charger.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c
index 1b4b5e09538e..43c44d2eaeca 100644
--- a/drivers/power/supply/tps65090-charger.c
+++ b/drivers/power/supply/tps65090-charger.c
@@ -202,10 +202,8 @@ static struct tps65090_platform_data *
unsigned int prop;
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata) {
- dev_err(&pdev->dev, "Memory alloc for tps65090_pdata failed\n");
+ if (!pdata)
return NULL;
- }
prop = of_property_read_bool(np, "ti,enable-low-current-chrg");
pdata->enable_low_current_chrg = prop;
@@ -257,10 +255,8 @@ static int tps65090_charger_probe(struct platform_device *pdev)
}
cdata = devm_kzalloc(&pdev->dev, sizeof(*cdata), GFP_KERNEL);
- if (!cdata) {
- dev_err(&pdev->dev, "failed to allocate memory status\n");
+ if (!cdata)
return -ENOMEM;
- }
platform_set_drvdata(pdev, cdata);
--
2.15.1
next reply other threads:[~2017-12-16 18:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-16 18:43 SF Markus Elfring [this message]
2017-12-16 18:53 ` [PATCH] tps65090-charger: Delete an error message for a failed memory allocation in two function Joe Perches
2017-12-16 20:30 ` tps65090-charger: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-12-16 20:36 ` Julia Lawall
2017-12-16 20:47 ` SF Markus Elfring
2017-12-18 17:24 ` Sebastian Reichel
2017-12-18 17:32 ` SF Markus Elfring
2017-12-16 20:40 ` Joe Perches
2017-12-16 20:52 ` SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa138aa9-d8c9-c6e3-7071-9fc642e7b248@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox