interconnect: core: 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/20200902172433.1138-1-krzk@kernel.org Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
This commit is contained in:
Родитель
628fdbcf9d
Коммит
392da338b2
|
@ -478,18 +478,14 @@ struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
|
|||
src_data = of_icc_get_from_provider(&src_args);
|
||||
|
||||
if (IS_ERR(src_data)) {
|
||||
if (PTR_ERR(src_data) != -EPROBE_DEFER)
|
||||
dev_err(dev, "error finding src node: %ld\n",
|
||||
PTR_ERR(src_data));
|
||||
dev_err_probe(dev, PTR_ERR(src_data), "error finding src node\n");
|
||||
return ERR_CAST(src_data);
|
||||
}
|
||||
|
||||
dst_data = of_icc_get_from_provider(&dst_args);
|
||||
|
||||
if (IS_ERR(dst_data)) {
|
||||
if (PTR_ERR(dst_data) != -EPROBE_DEFER)
|
||||
dev_err(dev, "error finding dst node: %ld\n",
|
||||
PTR_ERR(dst_data));
|
||||
dev_err_probe(dev, PTR_ERR(dst_data), "error finding dst node\n");
|
||||
kfree(src_data);
|
||||
return ERR_CAST(dst_data);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче