diff mbox series

[06/11] staging/lynxfb: Use pci aperture helper

Message ID 20230111154112.90575-6-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series [01/11] drm/ast: Use drm_aperture_remove_conflicting_pci_framebuffers | expand

Commit Message

Daniel Vetter Jan. 11, 2023, 3:41 p.m. UTC
It exists! Note that since this is an exact copy, there shouldn't be
any functional difference here.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: linux-fbdev@vger.kernel.org
---
 drivers/staging/sm750fb/sm750.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

Comments

Thomas Zimmermann Jan. 11, 2023, 4:05 p.m. UTC | #1
Hi

Am 11.01.23 um 16:41 schrieb Daniel Vetter:
> It exists! Note that since this is an exact copy, there shouldn't be
> any functional difference here.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> Cc: Teddy Wang <teddy.wang@siliconmotion.com>
> Cc: linux-fbdev@vger.kernel.org
> ---
>   drivers/staging/sm750fb/sm750.c | 16 +---------------
>   1 file changed, 1 insertion(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index effc7fcc3703..22ace3168723 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -989,20 +989,6 @@ static int sm750fb_framebuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
>   	return err;
>   }
>   
> -static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
> -{
> -	resource_size_t base = pci_resource_start(pdev, 0);
> -	resource_size_t size = pci_resource_len(pdev, 0);
> -	bool primary = false;
> -
> -#ifdef CONFIG_X86
> -	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> -					IORESOURCE_ROM_SHADOW;
> -#endif
> -
> -	return aperture_remove_conflicting_devices(base, size, primary, "sm750_fb1");

This still had the primary argument, it needs to be handled in an early 
patch in some way.

> -}
> -
>   static int lynxfb_pci_probe(struct pci_dev *pdev,
>   			    const struct pci_device_id *ent)
>   {
> @@ -1011,7 +997,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
>   	int fbidx;
>   	int err;
>   
> -	err = lynxfb_kick_out_firmware_fb(pdev);
> +	err = aperture_remove_conflicting_pci_devices(pdev, "sm750_fb1");
>   	if (err)
>   		return err;
>
diff mbox series

Patch

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index effc7fcc3703..22ace3168723 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -989,20 +989,6 @@  static int sm750fb_framebuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
 	return err;
 }
 
-static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	resource_size_t base = pci_resource_start(pdev, 0);
-	resource_size_t size = pci_resource_len(pdev, 0);
-	bool primary = false;
-
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-					IORESOURCE_ROM_SHADOW;
-#endif
-
-	return aperture_remove_conflicting_devices(base, size, primary, "sm750_fb1");
-}
-
 static int lynxfb_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -1011,7 +997,7 @@  static int lynxfb_pci_probe(struct pci_dev *pdev,
 	int fbidx;
 	int err;
 
-	err = lynxfb_kick_out_firmware_fb(pdev);
+	err = aperture_remove_conflicting_pci_devices(pdev, "sm750_fb1");
 	if (err)
 		return err;