Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: meson-g12a: 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>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20190802130408.20336-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

YueHaibing and committed by
Greg Kroah-Hartman
d3523b63 eb6c2eb6

+1 -3
+1 -3
drivers/usb/dwc3/dwc3-meson-g12a.c
··· 386 386 struct device *dev = &pdev->dev; 387 387 struct device_node *np = dev->of_node; 388 388 void __iomem *base; 389 - struct resource *res; 390 389 enum phy_mode otg_id; 391 390 int ret, i, irq; 392 391 ··· 393 394 if (!priv) 394 395 return -ENOMEM; 395 396 396 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 397 - base = devm_ioremap_resource(dev, res); 397 + base = devm_platform_ioremap_resource(pdev, 0); 398 398 if (IS_ERR(base)) 399 399 return PTR_ERR(base); 400 400