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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
b2fb212d9e
commit
b619c2ea32
@@ -76,7 +76,6 @@ static void img_ir_ident(struct img_ir_priv *priv)
|
|||||||
static int img_ir_probe(struct platform_device *pdev)
|
static int img_ir_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct img_ir_priv *priv;
|
struct img_ir_priv *priv;
|
||||||
struct resource *res_regs;
|
|
||||||
int irq, error, error2;
|
int irq, error, error2;
|
||||||
|
|
||||||
/* Get resources from platform device */
|
/* Get resources from platform device */
|
||||||
@@ -94,8 +93,7 @@ static int img_ir_probe(struct platform_device *pdev)
|
|||||||
spin_lock_init(&priv->lock);
|
spin_lock_init(&priv->lock);
|
||||||
|
|
||||||
/* Ioremap the registers */
|
/* Ioremap the registers */
|
||||||
res_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
priv->reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
priv->reg_base = devm_ioremap_resource(&pdev->dev, res_regs);
|
|
||||||
if (IS_ERR(priv->reg_base))
|
if (IS_ERR(priv->reg_base))
|
||||||
return PTR_ERR(priv->reg_base);
|
return PTR_ERR(priv->reg_base);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user