Commit 45c5277f authored by Srinivas Neeli's avatar Srinivas Neeli Committed by Bartosz Golaszewski
Browse files

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: default avatarSrinivas Neeli <srinivas.neeli@xilinx.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 78034b8e
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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) {