usb: dwc3: no need to initialize ret variable
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 15 May 2014 12:53:32 +0000 (15:53 +0300)
committerFelipe Balbi <balbi@ti.com>
Thu, 15 May 2014 15:26:21 +0000 (10:26 -0500)
First usage of ret variable will re-write initial value. Thus, there is no need
to initialize it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-exynos.c
drivers/usb/dwc3/dwc3-omap.c
drivers/usb/dwc3/dwc3-pci.c
drivers/usb/dwc3/gadget.c

index af8c8f6e67b32903cb4098b935a421d6a1e0906a..3f59c124782515b37e04bf4d0b1275e72d29d957 100644 (file)
@@ -626,7 +626,7 @@ static int dwc3_probe(struct platform_device *pdev)
        struct resource         *res;
        struct dwc3             *dwc;
 
-       int                     ret = -ENOMEM;
+       int                     ret;
 
        void __iomem            *regs;
        void                    *mem;
index 0ed85834bfec0a995086008fd78212d9f3ef6ff2..f9fb8adb785b7eb35c158dd2e9ad8e5f577fe6d8 100644 (file)
@@ -110,12 +110,12 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
        struct device           *dev = &pdev->dev;
        struct device_node      *node = dev->of_node;
 
-       int                     ret = -ENOMEM;
+       int                     ret;
 
        exynos = devm_kzalloc(dev, sizeof(*exynos), GFP_KERNEL);
        if (!exynos) {
                dev_err(dev, "not enough memory\n");
-               goto err1;
+               return -ENOMEM;
        }
 
        /*
@@ -125,21 +125,20 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
         */
        ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
        if (ret)
-               goto err1;
+               return ret;
 
        platform_set_drvdata(pdev, exynos);
 
        ret = dwc3_exynos_register_phys(exynos);
        if (ret) {
                dev_err(dev, "couldn't register PHYs\n");
-               goto err1;
+               return ret;
        }
 
        clk = devm_clk_get(dev, "usbdrd30");
        if (IS_ERR(clk)) {
                dev_err(dev, "couldn't get clock\n");
-               ret = -EINVAL;
-               goto err1;
+               return -EINVAL;
        }
 
        exynos->dev     = dev;
@@ -189,7 +188,6 @@ err3:
        regulator_disable(exynos->vdd33);
 err2:
        clk_disable_unprepare(clk);
-err1:
        return ret;
 }
 
index 1160ff41bed4972fb2c11ea576ddecfc9a9f2548..4af4c3567656388062f469f4b5abd10c45904d31 100644 (file)
@@ -393,7 +393,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
        struct extcon_dev       *edev;
        struct regulator        *vbus_reg = NULL;
 
-       int                     ret = -ENOMEM;
+       int                     ret;
        int                     irq;
 
        int                     utmi_mode = 0;
index 1ed95e0386ebd44c65c9534d140e34c2a175d098..e76d1ca5531c32a81156b356caa37a37fbfb9339 100644 (file)
@@ -99,7 +99,7 @@ static int dwc3_pci_probe(struct pci_dev *pci,
        struct resource         res[2];
        struct platform_device  *dwc3;
        struct dwc3_pci         *glue;
-       int                     ret = -ENOMEM;
+       int                     ret;
        struct device           *dev = &pci->dev;
 
        glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
index e0b7910509305706d5aa963ec16a7932e22f3350..696b472274ef97ae3d4851a7be589bd2415ac436 100644 (file)
@@ -584,7 +584,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
 {
        struct dwc3             *dwc = dep->dwc;
        u32                     reg;
-       int                     ret = -ENOMEM;
+       int                     ret;
 
        dev_vdbg(dwc->dev, "Enabling %s\n", dep->name);