forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
436a5c2080
commit
2d9bdf6455
|
@ -139,9 +139,8 @@ static int spi_mux_probe(struct spi_device *spi)
|
||||||
|
|
||||||
priv->mux = devm_mux_control_get(&spi->dev, NULL);
|
priv->mux = devm_mux_control_get(&spi->dev, NULL);
|
||||||
if (IS_ERR(priv->mux)) {
|
if (IS_ERR(priv->mux)) {
|
||||||
ret = PTR_ERR(priv->mux);
|
ret = dev_err_probe(&spi->dev, PTR_ERR(priv->mux),
|
||||||
if (ret != -EPROBE_DEFER)
|
"failed to get control-mux\n");
|
||||||
dev_err(&spi->dev, "failed to get control-mux\n");
|
|
||||||
goto err_put_ctlr;
|
goto err_put_ctlr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user