mirror of https://gitee.com/openkylin/linux.git
mmc: dw_mmc: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code, the error value gets printed and real error from dw_mci_parse_dt() is passed further instead of fixed -EINVAL. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20200902193658.20539-10-krzk@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
180a46652e
commit
308d2722f6
|
@ -3161,12 +3161,9 @@ int dw_mci_probe(struct dw_mci *host)
|
|||
|
||||
if (!host->pdata) {
|
||||
host->pdata = dw_mci_parse_dt(host);
|
||||
if (PTR_ERR(host->pdata) == -EPROBE_DEFER) {
|
||||
return -EPROBE_DEFER;
|
||||
} else if (IS_ERR(host->pdata)) {
|
||||
dev_err(host->dev, "platform data not available\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (IS_ERR(host->pdata))
|
||||
return dev_err_probe(host->dev, PTR_ERR(host->pdata),
|
||||
"platform data not available\n");
|
||||
}
|
||||
|
||||
host->biu_clk = devm_clk_get(host->dev, "biu");
|
||||
|
|
Loading…
Reference in New Issue