mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-07 10:03:24 +00:00
soc: qcom: smp2p: Use common error handling code in qcom_smp2p_probe()
* Add a jump target so that a specific error message is stored only once at the end of this function implementation. * Replace two calls of the function "dev_err" by goto statements. * Adjust two condition checks. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Andy Gross <andy.gross@linaro.org>
This commit is contained in:
parent
3830d0771e
commit
c01fc2275e
@ -473,17 +473,13 @@ static int qcom_smp2p_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
key = "qcom,local-pid";
|
key = "qcom,local-pid";
|
||||||
ret = of_property_read_u32(pdev->dev.of_node, key, &smp2p->local_pid);
|
ret = of_property_read_u32(pdev->dev.of_node, key, &smp2p->local_pid);
|
||||||
if (ret < 0) {
|
if (ret)
|
||||||
dev_err(&pdev->dev, "failed to read %s\n", key);
|
goto report_read_failure;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
key = "qcom,remote-pid";
|
key = "qcom,remote-pid";
|
||||||
ret = of_property_read_u32(pdev->dev.of_node, key, &smp2p->remote_pid);
|
ret = of_property_read_u32(pdev->dev.of_node, key, &smp2p->remote_pid);
|
||||||
if (ret < 0) {
|
if (ret)
|
||||||
dev_err(&pdev->dev, "failed to read %s\n", key);
|
goto report_read_failure;
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
irq = platform_get_irq(pdev, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (irq < 0) {
|
if (irq < 0) {
|
||||||
@ -566,6 +562,10 @@ release_mbox:
|
|||||||
mbox_free_channel(smp2p->mbox_chan);
|
mbox_free_channel(smp2p->mbox_chan);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
report_read_failure:
|
||||||
|
dev_err(&pdev->dev, "failed to read %s\n", key);
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcom_smp2p_remove(struct platform_device *pdev)
|
static int qcom_smp2p_remove(struct platform_device *pdev)
|
||||||
|
Loading…
Reference in New Issue
Block a user