summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/udc/bdc
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-09-04 17:33:35 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-04 14:09:40 +0200
commit893a66d342981f8b67cdbf476f0b81f7015cda49 (patch)
treea80a911ac2ec9b594d40c843bbe3e7c4a3ddb985 /drivers/usb/gadget/udc/bdc
parentec035f91297d81506384c18563101a2c21cd8177 (diff)
usb: bdc: 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/20190904093335.22860-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/udc/bdc')
-rw-r--r--drivers/usb/gadget/udc/bdc/bdc_core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index cc4a16e253ac..02a3a774670b 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -480,7 +480,6 @@ static void bdc_phy_exit(struct bdc *bdc)
static int bdc_probe(struct platform_device *pdev)
{
struct bdc *bdc;
- struct resource *res;
int ret = -ENOMEM;
int irq;
u32 temp;
@@ -508,8 +507,7 @@ static int bdc_probe(struct platform_device *pdev)
bdc->clk = clk;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- bdc->regs = devm_ioremap_resource(dev, res);
+ bdc->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(bdc->regs)) {
dev_err(dev, "ioremap error\n");
return -ENOMEM;