public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Philipp Stanner <pstanner@redhat.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: drm/lsdc: Request PCI BAR
Date: Mon, 21 Oct 2024 17:41:45 +0800	[thread overview]
Message-ID: <a0200145-deaa-4db1-810a-827b4b11103c@linux.dev> (raw)
In-Reply-To: <20241021091116.14368-1-pstanner@redhat.com>

Hi,  thanks

On 2024/10/21 17:11, Philipp Stanner wrote:
> lsdc currently just ioremaps its PCI BAR with pcim_iomap(). Performing
> a region regquest additionally can make the driver more robust.
>
> Replace pcim_iomap() with the managed function pcim_iomap_region() which
> performs the request and ioremaps the BAR.
>
> Signed-off-by: Philipp Stanner <pstanner@redhat.com>


Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>


> ---
>   drivers/gpu/drm/loongson/lsdc_drv.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c b/drivers/gpu/drm/loongson/lsdc_drv.c
> index adc7344d2f80..592d01b6767e 100644
> --- a/drivers/gpu/drm/loongson/lsdc_drv.c
> +++ b/drivers/gpu/drm/loongson/lsdc_drv.c
> @@ -230,9 +230,9 @@ lsdc_create_device(struct pci_dev *pdev,
>   	lsdc_gem_init(ddev);
>   
>   	/* Bar 0 of the DC device contains the MMIO register's base address */
> -	ldev->reg_base = pcim_iomap(pdev, 0, 0);
> -	if (!ldev->reg_base)
> -		return ERR_PTR(-ENODEV);
> +	ldev->reg_base = pcim_iomap_region(pdev, 0, "lsdc");
> +	if (IS_ERR(ldev->reg_base))
> +		return ldev->reg_base;
>   
>   	spin_lock_init(&ldev->reglock);
>   

-- 
Best regards,
Sui


      reply	other threads:[~2024-10-21  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  9:11 [PATCH] drm/lsdc: Request PCI BAR Philipp Stanner
2024-10-21  9:41 ` Sui Jingfeng [this message]

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=a0200145-deaa-4db1-810a-827b4b11103c@linux.dev \
    --to=sui.jingfeng@linux.dev \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=pstanner@redhat.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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