summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorSrinivas Neeli <srinivas.neeli@xilinx.com>2021-01-29 17:26:46 +0300
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-02-15 13:43:33 +0300
commit45c5277f347841daefb1a7b48da9904ef9b46ca9 (patch)
tree1781d410d2b9739a2b642c2fc8ff9bb2592b13dc /drivers/gpio
parent78034b8e072d01a9c9cf8ef667b7fc2806017608 (diff)
downloadlinux-45c5277f347841daefb1a7b48da9904ef9b46ca9.tar.xz
gpio: gpio-xilinx: Simplify with dev_err_probe()
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> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-xilinx.c7
1 files 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) {