diff mbox

[09/13] staging: sm750fb: use simpler remove_conflicting_pci_framebuffers()

Message ID ef1e85c2f7893ef972377939a3b6f68d80ff849a.1511544782.git.mirq-linux@rere.qmqm.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Michał Mirosław Nov. 24, 2017, 5:53 p.m. UTC
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/staging/sm750fb/sm750.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

Comments

Daniel Vetter Nov. 27, 2017, 10:25 a.m. UTC | #1
On Fri, Nov 24, 2017 at 06:53:33PM +0100, Michał Mirosław wrote:
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---

Why exactly do we have an fbdev driver in staging? Afaiui fbdev is
entirely closed for new drivers (pls convert to an atomic drm driver
instead, it likely will be smaller even).

That's even worse than having a non-atomic drm driver in staging ...
-Daniel

>  drivers/staging/sm750fb/sm750.c | 22 +---------------------
>  1 file changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 67207b0554cd..0590fc45c493 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -1053,26 +1053,6 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
>  	return err;
>  }
>  
> -static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
> -{
> -	struct apertures_struct *ap;
> -	bool primary = false;
> -
> -	ap = alloc_apertures(1);
> -	if (!ap)
> -		return -ENOMEM;
> -
> -	ap->ranges[0].base = pci_resource_start(pdev, 0);
> -	ap->ranges[0].size = pci_resource_len(pdev, 0);
> -#ifdef CONFIG_X86
> -	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
> -					IORESOURCE_ROM_SHADOW;
> -#endif
> -	remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
> -	kfree(ap);
> -	return 0;
> -}
> -
>  static int lynxfb_pci_probe(struct pci_dev *pdev,
>  			    const struct pci_device_id *ent)
>  {
> @@ -1081,7 +1061,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
>  	int fbidx;
>  	int err;
>  
> -	err = lynxfb_kick_out_firmware_fb(pdev);
> +	err = remove_conflicting_pci_framebuffers(pdev, 0, "sm750_fb1");
>  	if (err)
>  		return err;
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sudip Mukherjee Nov. 27, 2017, 8:57 p.m. UTC | #2
On Mon, Nov 27, 2017 at 11:25:05AM +0100, Daniel Vetter wrote:
> On Fri, Nov 24, 2017 at 06:53:33PM +0100, Michał Mirosław wrote:
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> 
> Why exactly do we have an fbdev driver in staging? Afaiui fbdev is
> entirely closed for new drivers (pls convert to an atomic drm driver
> instead, it likely will be smaller even).

This is in staging for many days now, it was added to staging even
before Tomi announced that he will not accept any new drivers in fbdev.

Converting it to drm driver is the plan and I will have a look into it.

--
Regards
Sudip
diff mbox

Patch

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 67207b0554cd..0590fc45c493 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1053,26 +1053,6 @@  static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
 	return err;
 }
 
-static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
-{
-	struct apertures_struct *ap;
-	bool primary = false;
-
-	ap = alloc_apertures(1);
-	if (!ap)
-		return -ENOMEM;
-
-	ap->ranges[0].base = pci_resource_start(pdev, 0);
-	ap->ranges[0].size = pci_resource_len(pdev, 0);
-#ifdef CONFIG_X86
-	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
-					IORESOURCE_ROM_SHADOW;
-#endif
-	remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
-	kfree(ap);
-	return 0;
-}
-
 static int lynxfb_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -1081,7 +1061,7 @@  static int lynxfb_pci_probe(struct pci_dev *pdev,
 	int fbidx;
 	int err;
 
-	err = lynxfb_kick_out_firmware_fb(pdev);
+	err = remove_conflicting_pci_framebuffers(pdev, 0, "sm750_fb1");
 	if (err)
 		return err;