Skip to content

Commit

Permalink
usb: gadget: udc: lpc32xx: Use devm_platform_ioremap_resource() in lp…
Browse files Browse the repository at this point in the history
…c32xx_udc_probe()

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
elfring authored and Felipe Balbi committed Oct 22, 2019
1 parent 5a15007 commit a9a367d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/usb/gadget/udc/lpc32xx_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3000,7 +3000,6 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct lpc32xx_udc *udc;
int retval, i;
struct resource *res;
dma_addr_t dma_handle;
struct device_node *isp1301_node;

Expand Down Expand Up @@ -3048,9 +3047,6 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
* IORESOURCE_IRQ, USB device interrupt number
* IORESOURCE_IRQ, USB transceiver interrupt number
*/
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENXIO;

spin_lock_init(&udc->lock);

Expand All @@ -3061,7 +3057,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
return udc->udp_irq[i];
}

udc->udp_baseaddr = devm_ioremap_resource(dev, res);
udc->udp_baseaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(udc->udp_baseaddr)) {
dev_err(udc->dev, "IO map failure\n");
return PTR_ERR(udc->udp_baseaddr);
Expand Down

0 comments on commit a9a367d

Please sign in to comment.