diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-09-01 17:27:08 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-09-08 18:19:27 +0100 |
commit | 2d9bdf645584d15ed1d4aae6204cb6ea8b673d48 (patch) | |
tree | ac2f21aec9e42a83f88c08d6fc868fa3dfcfed3f /drivers/spi/spi-mux.c | |
parent | 436a5c208037a71f64f35312969e27a05d6d7c53 (diff) |
spi: spi-mux: 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>
Link: https://lore.kernel.org/r/20200901152713.18629-6-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mux.c')
-rw-r--r-- | drivers/spi/spi-mux.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/spi/spi-mux.c b/drivers/spi/spi-mux.c index cc9ef371db14..37dfc6e82804 100644 --- a/drivers/spi/spi-mux.c +++ b/drivers/spi/spi-mux.c @@ -139,9 +139,8 @@ static int spi_mux_probe(struct spi_device *spi) priv->mux = devm_mux_control_get(&spi->dev, NULL); if (IS_ERR(priv->mux)) { - ret = PTR_ERR(priv->mux); - if (ret != -EPROBE_DEFER) - dev_err(&spi->dev, "failed to get control-mux\n"); + ret = dev_err_probe(&spi->dev, PTR_ERR(priv->mux), + "failed to get control-mux\n"); goto err_put_ctlr; } |