From: Thomas Zimmermann <tzimmermann@suse.de>
To: Philipp Stanner <pstanner@redhat.com>,
Dave Airlie <airlied@redhat.com>,
Jocelyn Falempe <jfalempe@redhat.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/ast: Request PCI BAR with devres
Date: Wed, 7 Aug 2024 10:59:26 +0200 [thread overview]
Message-ID: <edb8cf4f-a82c-41be-8316-dd316050d975@suse.de> (raw)
In-Reply-To: <20240807083018.8734-4-pstanner@redhat.com>
Am 07.08.24 um 10:30 schrieb Philipp Stanner:
> 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>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/ast/ast_drv.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c
> index aae019e79bda..1fadaadfbe39 100644
> --- a/drivers/gpu/drm/ast/ast_drv.c
> +++ b/drivers/gpu/drm/ast/ast_drv.c
> @@ -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.
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
next prev parent reply other threads:[~2024-08-07 8:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 8:30 [PATCH 1/2] PCI: Deprecate pcim_iomap_regions() in favor of pcim_iomap_region() Philipp Stanner
2024-08-07 8:30 ` [PATCH 2/2] drm/ast: Request PCI BAR with devres Philipp Stanner
2024-08-07 8:59 ` Thomas Zimmermann [this message]
2024-08-07 20:24 ` [PATCH 1/2] PCI: Deprecate pcim_iomap_regions() in favor of pcim_iomap_region() Bjorn Helgaas
2024-08-07 20:40 ` David Airlie
2024-08-09 20:09 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=edb8cf4f-a82c-41be-8316-dd316050d975@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=bhelgaas@google.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jfalempe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=pstanner@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox