From: Srinivas Neeli <srinivas.neeli@xilinx.com>
To: <linus.walleij@linaro.org>, <bgolaszewski@baylibre.com>,
<michal.simek@xilinx.com>, <shubhrajyoti.datta@xilinx.com>,
<sgoud@xilinx.com>, <hancock@sedsystems.ca>,
<vilhelm.gray@gmail.com>, <syednwaris@gmail.com>
Cc: <linux-gpio@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <git@xilinx.com>,
Srinivas Neeli <srinivas.neeli@xilinx.com>
Subject: [PATCH V4 1/5] gpio: gpio-xilinx: Simplify with dev_err_probe()
Date: Wed, 6 Jan 2021 17:56:36 +0530 [thread overview]
Message-ID: <1609936000-28378-2-git-send-email-srinivas.neeli@xilinx.com> (raw)
In-Reply-To: <1609936000-28378-1-git-send-email-srinivas.neeli@xilinx.com>
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
---
Changes in V4:
-New patch
---
drivers/gpio/gpio-xilinx.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index be539381fd82..d010a63d5d15 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -357,11 +357,8 @@ static int xgpio_probe(struct platform_device *pdev)
}
chip->clk = devm_clk_get_optional(&pdev->dev, NULL);
- if (IS_ERR(chip->clk)) {
- if (PTR_ERR(chip->clk) != -EPROBE_DEFER)
- dev_dbg(&pdev->dev, "Input clock not found\n");
- return PTR_ERR(chip->clk);
- }
+ if (IS_ERR(chip->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(chip->clk), "input clock not found.\n");
status = clk_prepare_enable(chip->clk);
if (status < 0) {
--
2.7.4
next prev parent reply other threads:[~2021-01-06 12:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 12:26 [PATCH V4 0/5] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2021-01-06 12:26 ` Srinivas Neeli [this message]
2021-01-07 9:13 ` [PATCH V4 1/5] gpio: gpio-xilinx: Simplify with dev_err_probe() Linus Walleij
2021-01-06 12:26 ` [PATCH V4 2/5] gpio: gpio-xilinx: Reduce spinlock array to array Srinivas Neeli
2021-01-07 9:14 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 3/5] gpio: gpio-xilinx: Add interrupt support Srinivas Neeli
2021-01-07 9:26 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 4/5] gpio: gpio-xilinx: Add support for suspend and resume Srinivas Neeli
2021-01-07 9:46 ` Linus Walleij
2021-01-08 11:41 ` Srinivas Neeli
2021-01-09 0:25 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32 Srinivas Neeli
2021-01-07 10:17 ` Linus Walleij
2021-01-07 10:29 ` Michal Simek
2021-01-07 10:47 ` Linus Walleij
2021-01-07 10:52 ` Michal Simek
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=1609936000-28378-2-git-send-email-srinivas.neeli@xilinx.com \
--to=srinivas.neeli@xilinx.com \
--cc=bgolaszewski@baylibre.com \
--cc=git@xilinx.com \
--cc=hancock@sedsystems.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=sgoud@xilinx.com \
--cc=shubhrajyoti.datta@xilinx.com \
--cc=syednwaris@gmail.com \
--cc=vilhelm.gray@gmail.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).