Commit e7705d26 authored by YueHaibing's avatar YueHaibing Committed by Felipe Balbi

usb: gadget: pxa27x_udc: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 62312807
...@@ -2356,7 +2356,6 @@ MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids); ...@@ -2356,7 +2356,6 @@ MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids);
*/ */
static int pxa_udc_probe(struct platform_device *pdev) static int pxa_udc_probe(struct platform_device *pdev)
{ {
struct resource *regs;
struct pxa_udc *udc = &memory; struct pxa_udc *udc = &memory;
int retval = 0, gpio; int retval = 0, gpio;
struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev); struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev);
...@@ -2378,8 +2377,7 @@ static int pxa_udc_probe(struct platform_device *pdev) ...@@ -2378,8 +2377,7 @@ static int pxa_udc_probe(struct platform_device *pdev)
udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS); udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS);
} }
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); udc->regs = devm_platform_ioremap_resource(pdev, 0);
udc->regs = devm_ioremap_resource(&pdev->dev, regs);
if (IS_ERR(udc->regs)) if (IS_ERR(udc->regs))
return PTR_ERR(udc->regs); return PTR_ERR(udc->regs);
udc->irq = platform_get_irq(pdev, 0); udc->irq = platform_get_irq(pdev, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment