From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-gpio@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Sonic Zhang <sonic.zhang@analog.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] pinctrl: adi2: Delete an error message for a failed memory allocation in two functions
Date: Wed, 20 Dec 2017 13:01:52 +0100 [thread overview]
Message-ID: <43b12b78-51a4-d590-9f61-e1ec61e291bc@users.sourceforge.net> (raw)
In-Reply-To: <3d620bed-db19-aacd-0ea5-4c64aee104d1@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Dec 2017 12:32:10 +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/pinctrl/pinctrl-adi2.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c
index 56aa181084ac..aefaf5855089 100644
--- a/drivers/pinctrl/pinctrl-adi2.c
+++ b/drivers/pinctrl/pinctrl-adi2.c
@@ -830,10 +830,8 @@ static int adi_gpio_pint_probe(struct platform_device *pdev)
struct gpio_pint *pint;
pint = devm_kzalloc(dev, sizeof(struct gpio_pint), GFP_KERNEL);
- if (!pint) {
- dev_err(dev, "Memory alloc failed\n");
+ if (!pint)
return -ENOMEM;
- }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pint->base = devm_ioremap_resource(dev, res);
@@ -946,10 +944,8 @@ static int adi_gpio_probe(struct platform_device *pdev)
return -EINVAL;
port = devm_kzalloc(dev, sizeof(struct gpio_port), GFP_KERNEL);
- if (!port) {
- dev_err(dev, "Memory alloc failed\n");
+ if (!port)
return -ENOMEM;
- }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
port->base = devm_ioremap_resource(dev, res);
--
2.15.1
next prev parent reply other threads:[~2017-12-20 12:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 12:00 [PATCH 0/2] Pinctrl-ADI GPIO2: Adjustments for two function implementations SF Markus Elfring
2017-12-20 12:01 ` SF Markus Elfring [this message]
2017-12-21 9:22 ` [PATCH 1/2] pinctrl: adi2: Delete an error message for a failed memory allocation in two functions Linus Walleij
2017-12-20 12:02 ` [PATCH 2/2] pinctrl: adi2: Improve a size determination " SF Markus Elfring
2017-12-21 9:23 ` Linus Walleij
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=43b12b78-51a4-d590-9f61-e1ec61e291bc@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sonic.zhang@analog.com \
/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;
as well as URLs for NNTP newsgroup(s).