diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-09-01 17:27:06 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-08 19:19:25 +0200 |
commit | 65acd82c4eb7f08747922ed3afb2d099a1b25d3f (patch) | |
tree | 6549ca3276ace11eb2c14af7e07b27b63b4a864b | |
parent | spi: atmel: Simplify with dev_err_probe() (diff) | |
download | linux-65acd82c4eb7f08747922ed3afb2d099a1b25d3f.tar.xz linux-65acd82c4eb7f08747922ed3afb2d099a1b25d3f.zip |
spi: bcm2835: 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 <krzk@kernel.org>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20200901152713.18629-4-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index c45d76c848c8..5519f1eda238 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1319,11 +1319,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) bs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(bs->clk)) { - err = PTR_ERR(bs->clk); - if (err == -EPROBE_DEFER) - dev_dbg(&pdev->dev, "could not get clk: %d\n", err); - else - dev_err(&pdev->dev, "could not get clk: %d\n", err); + err = dev_err_probe(&pdev->dev, PTR_ERR(bs->clk), + "could not get clk\n"); goto out_controller_put; } |