Return directly from driver and do not use done label.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
struct xusbps_usb2_platform_data *pdata;
pdata = pdev->dev.platform_data;
- if (!pdata) {
- retval = -ENODEV;
- goto done;
- }
+ if (!pdata)
+ return -ENODEV;
retval = 0;
dev_dbg(&pdev->dev, "\notg controller is detected.\n");
xotg = kzalloc(sizeof *xotg, GFP_KERNEL);
- if (xotg == NULL) {
- retval = -ENOMEM;
- goto done;
- }
+ if (xotg == NULL)
+ return -ENOMEM;
+
the_transceiver = xotg;
xotg->otg.otg = kzalloc(sizeof(struct usb_otg), GFP_KERNEL);
if (!xotg->otg.otg) {
kfree(xotg);
- retval = -ENOMEM;
- goto done;
+ return -ENOMEM;
}
xotg->base = pdata->regs;
err:
if (the_transceiver)
xusbps_otg_remove(pdev);
-done:
+
return retval;
}