Commit ea6c25e6 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Marc Zyngier

irqchip/ti-sci: 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.

There is also no need to assign NULL to 'intr->sci' as it is part of
devm-allocated memory.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200902174615.24695-1-krzk@kernel.org
parent f4d51dff
...@@ -600,13 +600,9 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev) ...@@ -600,13 +600,9 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev)
inta->pdev = pdev; inta->pdev = pdev;
inta->sci = devm_ti_sci_get_by_phandle(dev, "ti,sci"); inta->sci = devm_ti_sci_get_by_phandle(dev, "ti,sci");
if (IS_ERR(inta->sci)) { if (IS_ERR(inta->sci))
ret = PTR_ERR(inta->sci); return dev_err_probe(dev, PTR_ERR(inta->sci),
if (ret != -EPROBE_DEFER) "ti,sci read fail\n");
dev_err(dev, "ti,sci read fail %d\n", ret);
inta->sci = NULL;
return ret;
}
ret = of_property_read_u32(dev->of_node, "ti,sci-dev-id", &inta->ti_sci_id); ret = of_property_read_u32(dev->of_node, "ti,sci-dev-id", &inta->ti_sci_id);
if (ret) { if (ret) {
......
...@@ -254,13 +254,9 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev) ...@@ -254,13 +254,9 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
} }
intr->sci = devm_ti_sci_get_by_phandle(dev, "ti,sci"); intr->sci = devm_ti_sci_get_by_phandle(dev, "ti,sci");
if (IS_ERR(intr->sci)) { if (IS_ERR(intr->sci))
ret = PTR_ERR(intr->sci); return dev_err_probe(dev, PTR_ERR(intr->sci),
if (ret != -EPROBE_DEFER) "ti,sci read fail\n");
dev_err(dev, "ti,sci read fail %d\n", ret);
intr->sci = NULL;
return ret;
}
ret = of_property_read_u32(dev_of_node(dev), "ti,sci-dev-id", ret = of_property_read_u32(dev_of_node(dev), "ti,sci-dev-id",
&intr->ti_sci_id); &intr->ti_sci_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment