]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: otg: usbps_otg: Simplify returning path in otg driver
authorMichal Simek <michal.simek@xilinx.com>
Thu, 22 Nov 2012 14:07:53 +0000 (15:07 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Sun, 2 Dec 2012 19:35:52 +0000 (20:35 +0100)
Return directly from driver and do not use done label.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/otg/xilinx_usbps_otg.c

index 92330cec98d4927f2928ccefd1563c74ed3c696b..edc56559290e1ee3414035c6563b88e623bb0ba2 100644 (file)
@@ -1928,26 +1928,22 @@ static int xusbps_otg_probe(struct platform_device *pdev)
        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;
@@ -2042,7 +2038,7 @@ static int xusbps_otg_probe(struct platform_device *pdev)
 err:
        if (the_transceiver)
                xusbps_otg_remove(pdev);
-done:
+
        return retval;
 }