Skip to content

Commit 2eb20b9

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
drm/ast: Request PCI BAR with devres
ast currently ioremaps two PCI BARs using pcim_iomap(). It does not perform a request on the regions, however, which would make the driver a bit more robust. PCI now offers pcim_iomap_region(), a managed function which both requests and ioremaps a BAR. Replace pcim_iomap() with pcim_iomap_region(). Suggested-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://lore.kernel.org/r/20240807083018.8734-4-pstanner@redhat.com Signed-off-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Dave Airlie <airlied@redhat.com>
1 parent d140f80 commit 2eb20b9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpu/drm/ast/ast_drv.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
287287
if (ret)
288288
return ret;
289289

290-
regs = pcim_iomap(pdev, 1, 0);
291-
if (!regs)
292-
return -EIO;
290+
regs = pcim_iomap_region(pdev, 1, "ast");
291+
if (IS_ERR(regs))
292+
return PTR_ERR(regs);
293293

294294
if (pdev->revision >= 0x40) {
295295
/*
@@ -311,9 +311,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
311311

312312
if (len < AST_IO_MM_LENGTH)
313313
return -EIO;
314-
ioregs = pcim_iomap(pdev, 2, 0);
315-
if (!ioregs)
316-
return -EIO;
314+
ioregs = pcim_iomap_region(pdev, 2, "ast");
315+
if (IS_ERR(ioregs))
316+
return PTR_ERR(ioregs);
317317
} else {
318318
/*
319319
* Anything else is best effort.

0 commit comments

Comments
 (0)