Commit 6394c2d9 authored by Cai Huoqing's avatar Cai Huoqing Committed by Mauro Carvalho Chehab

media: sti: 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: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5d3b9611
...@@ -1315,8 +1315,7 @@ static int bdisp_probe(struct platform_device *pdev) ...@@ -1315,8 +1315,7 @@ static int bdisp_probe(struct platform_device *pdev)
mutex_init(&bdisp->lock); mutex_init(&bdisp->lock);
/* get resources */ /* get resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); bdisp->regs = devm_platform_ioremap_resource(pdev, 0);
bdisp->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(bdisp->regs)) { if (IS_ERR(bdisp->regs)) {
ret = PTR_ERR(bdisp->regs); ret = PTR_ERR(bdisp->regs);
goto err_wq; goto err_wq;
......
...@@ -298,15 +298,13 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva) ...@@ -298,15 +298,13 @@ static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva)
int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva) int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct resource *regs;
struct resource *esram; struct resource *esram;
int ret; int ret;
WARN_ON(!hva); WARN_ON(!hva);
/* get memory for registers */ /* get memory for registers */
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); hva->regs = devm_platform_ioremap_resource(pdev, 0);
hva->regs = devm_ioremap_resource(dev, regs);
if (IS_ERR(hva->regs)) { if (IS_ERR(hva->regs)) {
dev_err(dev, "%s failed to get regs\n", HVA_PREFIX); dev_err(dev, "%s failed to get regs\n", HVA_PREFIX);
return PTR_ERR(hva->regs); return PTR_ERR(hva->regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment