media: davinci: 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:
parent
9caf7a0a09
commit
bcbeade15a
@ -621,7 +621,6 @@ static int venc_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct platform_device_id *pdev_id;
|
||||
struct venc_state *venc;
|
||||
struct resource *res;
|
||||
|
||||
if (!pdev->dev.platform_data) {
|
||||
dev_err(&pdev->dev, "No platform data for VENC sub device");
|
||||
@ -640,16 +639,12 @@ static int venc_probe(struct platform_device *pdev)
|
||||
venc->pdev = &pdev->dev;
|
||||
venc->pdata = pdev->dev.platform_data;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
||||
venc->venc_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
venc->venc_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(venc->venc_base))
|
||||
return PTR_ERR(venc->venc_base);
|
||||
|
||||
if (venc->venc_type != VPBE_VERSION_1) {
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
|
||||
venc->vdaccfg_reg = devm_ioremap_resource(&pdev->dev, res);
|
||||
venc->vdaccfg_reg = devm_platform_ioremap_resource(pdev, 1);
|
||||
if (IS_ERR(venc->vdaccfg_reg))
|
||||
return PTR_ERR(venc->vdaccfg_reg);
|
||||
}
|
||||
|
@ -425,12 +425,11 @@ EXPORT_SYMBOL(vpif_channel_getfid);
|
||||
|
||||
static int vpif_probe(struct platform_device *pdev)
|
||||
{
|
||||
static struct resource *res, *res_irq;
|
||||
static struct resource *res_irq;
|
||||
struct platform_device *pdev_capture, *pdev_display;
|
||||
struct device_node *endpoint = NULL;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
vpif_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
vpif_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(vpif_base))
|
||||
return PTR_ERR(vpif_base);
|
||||
|
||||
|
@ -392,7 +392,6 @@ EXPORT_SYMBOL(dm365_vpss_set_pg_frame_size);
|
||||
|
||||
static int vpss_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
char *platform_name;
|
||||
|
||||
if (!pdev->dev.platform_data) {
|
||||
@ -413,17 +412,12 @@ static int vpss_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
dev_info(&pdev->dev, "%s vpss probed\n", platform_name);
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
||||
oper_cfg.vpss_regs_base0 = devm_ioremap_resource(&pdev->dev, res);
|
||||
oper_cfg.vpss_regs_base0 = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(oper_cfg.vpss_regs_base0))
|
||||
return PTR_ERR(oper_cfg.vpss_regs_base0);
|
||||
|
||||
if (oper_cfg.platform == DM355 || oper_cfg.platform == DM365) {
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||
|
||||
oper_cfg.vpss_regs_base1 = devm_ioremap_resource(&pdev->dev,
|
||||
res);
|
||||
oper_cfg.vpss_regs_base1 = devm_platform_ioremap_resource(pdev, 1);
|
||||
if (IS_ERR(oper_cfg.vpss_regs_base1))
|
||||
return PTR_ERR(oper_cfg.vpss_regs_base1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user