[PATCH 1/2] interconnect: core: Simplify with dev_err_probe()
From: Krzysztof Kozlowski
Date: Wed Sep 02 2020 - 13:24:44 EST
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@xxxxxxxxxx>
---
drivers/interconnect/core.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index befd111049c0..3d5d719de175 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -444,18 +444,14 @@ struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
src_node = of_icc_get_from_provider(&src_args);
if (IS_ERR(src_node)) {
- if (PTR_ERR(src_node) != -EPROBE_DEFER)
- dev_err(dev, "error finding src node: %ld\n",
- PTR_ERR(src_node));
+ dev_err_probe(dev, PTR_ERR(src_node), "error finding src node\n");
return ERR_CAST(src_node);
}
dst_node = of_icc_get_from_provider(&dst_args);
if (IS_ERR(dst_node)) {
- if (PTR_ERR(dst_node) != -EPROBE_DEFER)
- dev_err(dev, "error finding dst node: %ld\n",
- PTR_ERR(dst_node));
+ dev_err_probe(dev, PTR_ERR(dst_node), "error finding dst node\n");
return ERR_CAST(dst_node);
}
--
2.17.1