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

drm/mcde: Make use of the helper function devm_platform_ioremap_resource()

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831135602.4476-1-caihuoqing@baidu.com

authored by

Cai Huoqing and committed by
Linus Walleij
c5baa944 d4c16733

+2 -6
+1 -3
drivers/gpu/drm/mcde/mcde_drv.c
··· 276 276 struct drm_device *drm; 277 277 struct mcde *mcde; 278 278 struct component_match *match = NULL; 279 - struct resource *res; 280 279 u32 pid; 281 280 int irq; 282 281 int ret; ··· 343 344 goto clk_disable; 344 345 } 345 346 346 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 347 - mcde->regs = devm_ioremap_resource(dev, res); 347 + mcde->regs = devm_platform_ioremap_resource(pdev, 0); 348 348 if (IS_ERR(mcde->regs)) { 349 349 dev_err(dev, "no MCDE regs\n"); 350 350 ret = -EINVAL;
+1 -3
drivers/gpu/drm/mcde/mcde_dsi.c
··· 1169 1169 struct device *dev = &pdev->dev; 1170 1170 struct mcde_dsi *d; 1171 1171 struct mipi_dsi_host *host; 1172 - struct resource *res; 1173 1172 u32 dsi_id; 1174 1173 int ret; 1175 1174 ··· 1186 1187 return PTR_ERR(d->prcmu); 1187 1188 } 1188 1189 1189 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1190 - d->regs = devm_ioremap_resource(dev, res); 1190 + d->regs = devm_platform_ioremap_resource(pdev, 0); 1191 1191 if (IS_ERR(d->regs)) 1192 1192 return PTR_ERR(d->regs); 1193 1193