summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2020-09-25 20:30:41 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-10-01 09:56:40 +0200
commite83bf68b5827e04fb36ad555b2b1b5776a4884a1 (patch)
tree5cec68a25856a421af7ca721fc5f01c7669b3c6f /drivers/staging
parent845556fd8027b895282c097cc709b535ab704d4f (diff)
media: zoran: use devm_ioremap
Using devm_ioremap simplify code. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/zoran/zoran_card.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/media/zoran/zoran_card.c b/drivers/staging/media/zoran/zoran_card.c
index f4639324bace..147bef1df33c 100644
--- a/drivers/staging/media/zoran/zoran_card.c
+++ b/drivers/staging/media/zoran/zoran_card.c
@@ -1010,7 +1010,6 @@ static void zoran_remove(struct pci_dev *pdev)
pci_free_irq(zr->pci_dev, 0, zr);
/* unmap and free memory */
dma_free_coherent(&zr->pci_dev->dev, BUZ_NUM_STAT_COM * sizeof(u32), zr->stat_com, zr->p_sc);
- iounmap(zr->zr36057_mem);
pci_release_regions(pdev);
pci_disable_device(zr->pci_dev);
video_unregister_device(zr->video_dev);
@@ -1165,7 +1164,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto zr_unreg;
- zr->zr36057_mem = pci_ioremap_bar(zr->pci_dev, 0);
+ zr->zr36057_mem = devm_ioremap(&pdev->dev, pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
if (!zr->zr36057_mem) {
pci_err(pdev, "%s() - ioremap failed\n", __func__);
goto zr_pci_release;
@@ -1181,7 +1180,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} else {
pci_err(pdev, "%s - cannot assign IRQ, error code %d\n", __func__, result);
}
- goto zr_unmap;
+ goto zr_pci_release;
}
/* set PCI latency timer */
@@ -1284,8 +1283,6 @@ zr_unreg_i2c:
zr_free_irq:
btwrite(0, ZR36057_SPGPPCR);
pci_free_irq(zr->pci_dev, 0, zr);
-zr_unmap:
- iounmap(zr->zr36057_mem);
zr_pci_release:
pci_release_regions(pdev);
zr_unreg: