Commit 893a66d3 authored by YueHaibing's avatar YueHaibing Committed by Greg Kroah-Hartman

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904093335.22860-1-yuehaibing@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec035f91
...@@ -480,7 +480,6 @@ static void bdc_phy_exit(struct bdc *bdc) ...@@ -480,7 +480,6 @@ static void bdc_phy_exit(struct bdc *bdc)
static int bdc_probe(struct platform_device *pdev) static int bdc_probe(struct platform_device *pdev)
{ {
struct bdc *bdc; struct bdc *bdc;
struct resource *res;
int ret = -ENOMEM; int ret = -ENOMEM;
int irq; int irq;
u32 temp; u32 temp;
...@@ -508,8 +507,7 @@ static int bdc_probe(struct platform_device *pdev) ...@@ -508,8 +507,7 @@ static int bdc_probe(struct platform_device *pdev)
bdc->clk = clk; bdc->clk = clk;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); bdc->regs = devm_platform_ioremap_resource(pdev, 0);
bdc->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(bdc->regs)) { if (IS_ERR(bdc->regs)) {
dev_err(dev, "ioremap error\n"); dev_err(dev, "ioremap error\n");
return -ENOMEM; return -ENOMEM;
......
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