Commit 3700df92 authored by Markus Elfring's avatar Markus Elfring Committed by Felipe Balbi

usb: gadget: bcm63xx_udc: Use common error handling code in bcm63xx_udc_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.

This issue was detected by using the Coccinelle software.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 71a9fda3
......@@ -2385,10 +2385,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
goto out_uninit;
}
if (devm_request_irq(dev, irq, &bcm63xx_udc_ctrl_isr, 0,
dev_name(dev), udc) < 0) {
dev_err(dev, "error requesting IRQ #%d\n", irq);
goto out_uninit;
}
dev_name(dev), udc) < 0)
goto report_request_failure;
/* IRQ resources #1-6: data interrupts for IUDMA channels 0-5 */
for (i = 0; i < BCM63XX_NUM_IUDMA; i++) {
......@@ -2398,10 +2396,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
goto out_uninit;
}
if (devm_request_irq(dev, irq, &bcm63xx_udc_data_isr, 0,
dev_name(dev), &udc->iudma[i]) < 0) {
dev_err(dev, "error requesting IRQ #%d\n", irq);
goto out_uninit;
}
dev_name(dev), &udc->iudma[i]) < 0)
goto report_request_failure;
}
bcm63xx_udc_init_debugfs(udc);
......@@ -2413,6 +2409,10 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
out_uninit:
bcm63xx_uninit_udc_hw(udc);
return rc;
report_request_failure:
dev_err(dev, "error requesting IRQ #%d\n", irq);
goto out_uninit;
}
/**
......
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