Skip to content

Commit 45c5277

Browse files
Srinivas Neelibrgl
authored andcommitted
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>
1 parent 78034b8 commit 45c5277

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/gpio/gpio-xilinx.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,8 @@ static int xgpio_probe(struct platform_device *pdev)
357357
}
358358

359359
chip->clk = devm_clk_get_optional(&pdev->dev, NULL);
360-
if (IS_ERR(chip->clk)) {
361-
if (PTR_ERR(chip->clk) != -EPROBE_DEFER)
362-
dev_dbg(&pdev->dev, "Input clock not found\n");
363-
return PTR_ERR(chip->clk);
364-
}
360+
if (IS_ERR(chip->clk))
361+
return dev_err_probe(&pdev->dev, PTR_ERR(chip->clk), "input clock not found.\n");
365362

366363
status = clk_prepare_enable(chip->clk);
367364
if (status < 0) {

0 commit comments

Comments
 (0)