diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-06 18:10:55 +0800 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-07-19 12:57:49 +0200 |
commit | 3490891f1900e8ba0b6e8da80b8f9226baac91f0 (patch) | |
tree | d78b7741085638f17367880f0df06bb7c799ffb3 /drivers/media/platform | |
parent | 7fa586ae754a5a909b8a58421c6e091669d3ce23 (diff) | |
download | linux-stable-3490891f1900e8ba0b6e8da80b8f9226baac91f0.tar.gz linux-stable-3490891f1900e8ba0b6e8da80b8f9226baac91f0.tar.bz2 linux-stable-3490891f1900e8ba0b6e8da80b8f9226baac91f0.zip |
media: verisilicon: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()
Use devm_platform_ioremap_resource() and
devm_platform_ioremap_resource_byname() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/verisilicon/hantro_drv.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c index 10cf5b686b21..35ca71b19def 100644 --- a/drivers/media/platform/verisilicon/hantro_drv.c +++ b/drivers/media/platform/verisilicon/hantro_drv.c @@ -986,7 +986,6 @@ static int hantro_probe(struct platform_device *pdev) { const struct of_device_id *match; struct hantro_dev *vpu; - struct resource *res; int num_bases; int i, ret; @@ -1047,11 +1046,9 @@ static int hantro_probe(struct platform_device *pdev) return -ENOMEM; for (i = 0; i < num_bases; i++) { - res = vpu->variant->reg_names ? - platform_get_resource_byname(vpu->pdev, IORESOURCE_MEM, - vpu->variant->reg_names[i]) : - platform_get_resource(vpu->pdev, IORESOURCE_MEM, 0); - vpu->reg_bases[i] = devm_ioremap_resource(vpu->dev, res); + vpu->reg_bases[i] = vpu->variant->reg_names ? + devm_platform_ioremap_resource_byname(pdev, vpu->variant->reg_names[i]) : + devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vpu->reg_bases[i])) return PTR_ERR(vpu->reg_bases[i]); } |