diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-09-04 11:45:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-04 14:09:39 +0200 |
commit | 9fd7a05e9776400f05fe07f81d3d71dc231d4fc3 (patch) | |
tree | a2ce5cc3cc118ecc4b6ce55fae6b27604ee3e68b /drivers/usb/gadget | |
parent | usb: gadget: r8a66597-udc: use devm_platform_ioremap_resource() to simplify code (diff) | |
download | linux-9fd7a05e9776400f05fe07f81d3d71dc231d4fc3.tar.xz linux-9fd7a05e9776400f05fe07f81d3d71dc231d4fc3.zip |
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: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904094557.22884-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc/pxa27x_udc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c index 014233252299..5f107f277f30 100644 --- a/drivers/usb/gadget/udc/pxa27x_udc.c +++ b/drivers/usb/gadget/udc/pxa27x_udc.c @@ -2356,7 +2356,6 @@ MODULE_DEVICE_TABLE(of, udc_pxa_dt_ids); */ static int pxa_udc_probe(struct platform_device *pdev) { - struct resource *regs; struct pxa_udc *udc = &memory; int retval = 0, gpio; struct pxa2xx_udc_mach_info *mach = dev_get_platdata(&pdev->dev); @@ -2378,8 +2377,7 @@ static int pxa_udc_probe(struct platform_device *pdev) udc->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS); } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - udc->regs = devm_ioremap_resource(&pdev->dev, regs); + udc->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(udc->regs)) return PTR_ERR(udc->regs); udc->irq = platform_get_irq(pdev, 0); |