usb: chipidea: imx: Use devm_platform_ioremap_resource()
authorFabio Estevam <festevam@gmail.com>
Wed, 5 Jun 2019 17:37:37 +0000 (14:37 -0300)
committerPeter Chen <peter.chen@nxp.com>
Fri, 14 Jun 2019 09:40:20 +0000 (17:40 +0800)
Use devm_platform_ioremap_resource() to simplify the code a bit.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/usbmisc_imx.c

index b7a5727d0c8a86999cf7de7015cb26d827b066a5..078c1fdce4932ebeadc4b0451907bffc08cbdfea 100644 (file)
@@ -773,7 +773,6 @@ MODULE_DEVICE_TABLE(of, usbmisc_imx_dt_ids);
 
 static int usbmisc_imx_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct imx_usbmisc *data;
        const struct of_device_id *of_id;
 
@@ -787,8 +786,7 @@ static int usbmisc_imx_probe(struct platform_device *pdev)
 
        spin_lock_init(&data->lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       data->base = devm_ioremap_resource(&pdev->dev, res);
+       data->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(data->base))
                return PTR_ERR(data->base);