Skip to content

Commit

Permalink
usb: dwc3: no need to initialize ret variable
Browse files Browse the repository at this point in the history
First usage of ret variable will re-write initial value. Thus, there is no need
to initialize it.

Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
andy-shev authored and Felipe Balbi committed May 15, 2014
1 parent 7419485 commit b09e99e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 5 additions & 7 deletions drivers/usb/dwc3/dwc3-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand All @@ -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;
Expand Down Expand Up @@ -189,7 +188,6 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
regulator_disable(exynos->vdd33);
err2:
clk_disable_unprepare(clk);
err1:
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/dwc3-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b09e99e

Please sign in to comment.