From: Yangtao Li Date: Wed, 26 Jul 2023 11:37:55 +0000 (+0800) Subject: usb: gadget: aspeed_udc: Convert to devm_platform_ioremap_resource() X-Git-Tag: v6.6.7~2020^2~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50fd16ebf2f18299373673cc5c2eeb1e8e1367ec;p=platform%2Fkernel%2Flinux-starfive.git usb: gadget: aspeed_udc: Convert to devm_platform_ioremap_resource() Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Link: https://lore.kernel.org/r/20230726113816.888-9-frank.li@vivo.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c index 01968e2..2ef89a4 100644 --- a/drivers/usb/gadget/udc/aspeed_udc.c +++ b/drivers/usb/gadget/udc/aspeed_udc.c @@ -1468,7 +1468,6 @@ static int ast_udc_probe(struct platform_device *pdev) enum usb_device_speed max_speed; struct device *dev = &pdev->dev; struct ast_udc_dev *udc; - struct resource *res; int rc; udc = devm_kzalloc(&pdev->dev, sizeof(struct ast_udc_dev), GFP_KERNEL); @@ -1484,8 +1483,7 @@ static int ast_udc_probe(struct platform_device *pdev) udc->gadget.name = "aspeed-udc"; udc->gadget.dev.init_name = "gadget"; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - udc->reg = devm_ioremap_resource(&pdev->dev, res); + udc->reg = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(udc->reg)) { dev_err(&pdev->dev, "Failed to map resources\n"); return PTR_ERR(udc->reg);