From: Krzysztof Kozlowski Date: Tue, 1 Sep 2020 15:27:10 +0000 (+0200) Subject: spi: stm32: Simplify with dev_err_probe() X-Git-Tag: v5.15~2347^2~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a05cec2dc2df1e5d25addb7aba398f3eb451e163;p=platform%2Fkernel%2Flinux-starfive.git spi: stm32: Simplify with dev_err_probe() Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20200901152713.18629-8-krzk@kernel.org Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index d4b33b3..f0e594b 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -1857,9 +1857,7 @@ static int stm32_spi_probe(struct platform_device *pdev) spi->irq = platform_get_irq(pdev, 0); if (spi->irq <= 0) { - ret = spi->irq; - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to get irq: %d\n", ret); + ret = dev_err_probe(&pdev->dev, spi->irq, "failed to get irq\n"); goto err_master_put; } ret = devm_request_threaded_irq(&pdev->dev, spi->irq,