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

media: rc: img-ir: 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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Cai Huoqing and committed by
Mauro Carvalho Chehab
b619c2ea b2fb212d

+1 -3
+1 -3
drivers/media/rc/img-ir/img-ir-core.c
··· 76 76 static int img_ir_probe(struct platform_device *pdev) 77 77 { 78 78 struct img_ir_priv *priv; 79 - struct resource *res_regs; 80 79 int irq, error, error2; 81 80 82 81 /* Get resources from platform device */ ··· 93 94 spin_lock_init(&priv->lock); 94 95 95 96 /* Ioremap the registers */ 96 - res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 97 - priv->reg_base = devm_ioremap_resource(&pdev->dev, res_regs); 97 + priv->reg_base = devm_platform_ioremap_resource(pdev, 0); 98 98 if (IS_ERR(priv->reg_base)) 99 99 return PTR_ERR(priv->reg_base); 100 100