Commit 2eb20b96 authored by Philipp Stanner's avatar Philipp Stanner Committed by Bjorn Helgaas

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: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20240807083018.8734-4-pstanner@redhat.comSigned-off-by: default avatarPhilipp Stanner <pstanner@redhat.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarDave Airlie <airlied@redhat.com>
parent d140f80f
......@@ -287,9 +287,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret)
return ret;
regs = pcim_iomap(pdev, 1, 0);
if (!regs)
return -EIO;
regs = pcim_iomap_region(pdev, 1, "ast");
if (IS_ERR(regs))
return PTR_ERR(regs);
if (pdev->revision >= 0x40) {
/*
......@@ -311,9 +311,9 @@ static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (len < AST_IO_MM_LENGTH)
return -EIO;
ioregs = pcim_iomap(pdev, 2, 0);
if (!ioregs)
return -EIO;
ioregs = pcim_iomap_region(pdev, 2, "ast");
if (IS_ERR(ioregs))
return PTR_ERR(ioregs);
} else {
/*
* Anything else is best effort.
......
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