mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
78034b8e07
commit
45c5277f34
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue