Skip to content

Commit

Permalink
jz4740_udc.c: tentative fix for upstream changes in USB driver framework
Browse files Browse the repository at this point in the history
This specifically addresses this sort of changes:

fc84d2f  let udc-core manage gadget->dev
7bce401  drop now unnecessary flag

"... because all UDC drivers have been properly converted." (which of
course doesn't apply to our out-of-tree driver)
  • Loading branch information
wpwrak committed May 8, 2013
1 parent 662b0cd commit db73cac
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/usb/gadget/jz4740_udc.c
Expand Up @@ -2023,15 +2023,11 @@ static int jz4740_udc_probe(struct platform_device *pdev)
jz4740_udc->gadget.dev.parent = &pdev->dev;
jz4740_udc->gadget.dev.dma_mask = pdev->dev.dma_mask;

ret = device_register(&jz4740_udc->gadget.dev);
if (ret)
return ret;

jz4740_udc->clk = clk_get(&pdev->dev, "udc");
if (IS_ERR(jz4740_udc->clk)) {
ret = PTR_ERR(jz4740_udc->clk);
dev_err(&pdev->dev, "Failed to get udc clock: %d\n", ret);
goto err_device_unregister;
goto err;
}

platform_set_drvdata(pdev, jz4740_udc);
Expand All @@ -2050,7 +2046,7 @@ static int jz4740_udc_probe(struct platform_device *pdev)
if (!jz4740_udc->mem) {
ret = -EBUSY;
dev_err(&pdev->dev, "Failed to request mmio memory region\n");
goto err_device_unregister;
goto err;
}

jz4740_udc->base = ioremap(jz4740_udc->mem->start, resource_size(jz4740_udc->mem));
Expand Down Expand Up @@ -2088,8 +2084,7 @@ static int jz4740_udc_probe(struct platform_device *pdev)
release_mem_region(jz4740_udc->mem->start, resource_size(jz4740_udc->mem));
err_clk_put:
clk_put(jz4740_udc->clk);
err_device_unregister:
device_unregister(&jz4740_udc->gadget.dev);
err:
platform_set_drvdata(pdev, NULL);

return ret;
Expand All @@ -2111,7 +2106,6 @@ static int jz4740_udc_remove(struct platform_device *pdev)
clk_put(dev->clk);

platform_set_drvdata(pdev, NULL);
device_unregister(&dev->gadget.dev);

return 0;
}
Expand Down

0 comments on commit db73cac

Please sign in to comment.