public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/lsdc: Request PCI BAR
@ 2024-10-21  9:11 Philipp Stanner
  2024-10-21  9:41 ` Sui Jingfeng
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Stanner @ 2024-10-21  9:11 UTC (permalink / raw)
  To: Sui Jingfeng, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Philipp Stanner

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>
---
 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);
 
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: drm/lsdc: Request PCI BAR
  2024-10-21  9:11 [PATCH] drm/lsdc: Request PCI BAR Philipp Stanner
@ 2024-10-21  9:41 ` Sui Jingfeng
  0 siblings, 0 replies; 2+ messages in thread
From: Sui Jingfeng @ 2024-10-21  9:41 UTC (permalink / raw)
  To: Philipp Stanner, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-21  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21  9:11 [PATCH] drm/lsdc: Request PCI BAR Philipp Stanner
2024-10-21  9:41 ` Sui Jingfeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox