Commit 5b76f6a0 authored by YueHaibing's avatar YueHaibing Committed by Felipe Balbi

usb: dwc3: keystone: 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 58dd0bad
...@@ -81,7 +81,6 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -81,7 +81,6 @@ static int kdwc3_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct dwc3_keystone *kdwc; struct dwc3_keystone *kdwc;
struct resource *res;
int error, irq; int error, irq;
kdwc = devm_kzalloc(dev, sizeof(*kdwc), GFP_KERNEL); kdwc = devm_kzalloc(dev, sizeof(*kdwc), GFP_KERNEL);
...@@ -92,8 +91,7 @@ static int kdwc3_probe(struct platform_device *pdev) ...@@ -92,8 +91,7 @@ static int kdwc3_probe(struct platform_device *pdev)
kdwc->dev = dev; kdwc->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); kdwc->usbss = devm_platform_ioremap_resource(pdev, 0);
kdwc->usbss = devm_ioremap_resource(dev, res);
if (IS_ERR(kdwc->usbss)) if (IS_ERR(kdwc->usbss))
return PTR_ERR(kdwc->usbss); return PTR_ERR(kdwc->usbss);
......
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