diff mbox series

[-next] video: fbdev: tridentfb: Fix missing pci_disable_device() in probe and remove

Message ID 20220922013709.3324521-1-ruanjinjie@huawei.com
State New
Headers show
Series [-next] video: fbdev: tridentfb: Fix missing pci_disable_device() in probe and remove | expand

Commit Message

Jinjie Ruan Sept. 22, 2022, 1:37 a.m. UTC
Replace pci_enable_device() with pcim_enable_device(),
pci_disable_device() and pci_release_regions() will be
called in release automatically.

Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
 drivers/video/fbdev/tridentfb.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Helge Deller Sept. 25, 2022, 4:21 p.m. UTC | #1
On 9/22/22 03:37, ruanjinjie wrote:
> Replace pci_enable_device() with pcim_enable_device(),
> pci_disable_device() and pci_release_regions() will be
> called in release automatically.
>
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>

applied.

Thanks!
Helge

> ---
>   drivers/video/fbdev/tridentfb.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c
> index f9c3b1d38fc2..7933e01aacc5 100644
> --- a/drivers/video/fbdev/tridentfb.c
> +++ b/drivers/video/fbdev/tridentfb.c
> @@ -1475,7 +1475,7 @@ static int trident_pci_probe(struct pci_dev *dev,
>   	if (err)
>   		return err;
>
> -	err = pci_enable_device(dev);
> +	err = pcim_enable_device(dev);
>   	if (err)
>   		return err;
>
> @@ -1715,12 +1715,10 @@ static int trident_pci_probe(struct pci_dev *dev,
>   	kfree(info->pixmap.addr);
>   	if (info->screen_base)
>   		iounmap(info->screen_base);
> -	release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
>   	disable_mmio(info->par);
>   out_unmap1:
>   	if (default_par->io_virt)
>   		iounmap(default_par->io_virt);
> -	release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
>   	framebuffer_release(info);
>   	return err;
>   }
> @@ -1735,8 +1733,6 @@ static void trident_pci_remove(struct pci_dev *dev)
>   		i2c_del_adapter(&par->ddc_adapter);
>   	iounmap(par->io_virt);
>   	iounmap(info->screen_base);
> -	release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
> -	release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
>   	kfree(info->pixmap.addr);
>   	fb_dealloc_cmap(&info->cmap);
>   	framebuffer_release(info);
Jinjie Ruan Sept. 26, 2022, 1:21 a.m. UTC | #2
Thank you very much!

On 2022/9/26 0:21, Helge Deller wrote:
> On 9/22/22 03:37, ruanjinjie wrote:
>> Replace pci_enable_device() with pcim_enable_device(),
>> pci_disable_device() and pci_release_regions() will be
>> called in release automatically.
>>
>> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> 
> applied.
> 
> Thanks!
> Helge
> 
>> ---
>>   drivers/video/fbdev/tridentfb.c | 6 +-----
>>   1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/tridentfb.c
>> b/drivers/video/fbdev/tridentfb.c
>> index f9c3b1d38fc2..7933e01aacc5 100644
>> --- a/drivers/video/fbdev/tridentfb.c
>> +++ b/drivers/video/fbdev/tridentfb.c
>> @@ -1475,7 +1475,7 @@ static int trident_pci_probe(struct pci_dev *dev,
>>       if (err)
>>           return err;
>>
>> -    err = pci_enable_device(dev);
>> +    err = pcim_enable_device(dev);
>>       if (err)
>>           return err;
>>
>> @@ -1715,12 +1715,10 @@ static int trident_pci_probe(struct pci_dev *dev,
>>       kfree(info->pixmap.addr);
>>       if (info->screen_base)
>>           iounmap(info->screen_base);
>> -    release_mem_region(tridentfb_fix.smem_start,
>> tridentfb_fix.smem_len);
>>       disable_mmio(info->par);
>>   out_unmap1:
>>       if (default_par->io_virt)
>>           iounmap(default_par->io_virt);
>> -    release_mem_region(tridentfb_fix.mmio_start,
>> tridentfb_fix.mmio_len);
>>       framebuffer_release(info);
>>       return err;
>>   }
>> @@ -1735,8 +1733,6 @@ static void trident_pci_remove(struct pci_dev *dev)
>>           i2c_del_adapter(&par->ddc_adapter);
>>       iounmap(par->io_virt);
>>       iounmap(info->screen_base);
>> -    release_mem_region(tridentfb_fix.smem_start,
>> tridentfb_fix.smem_len);
>> -    release_mem_region(tridentfb_fix.mmio_start,
>> tridentfb_fix.mmio_len);
>>       kfree(info->pixmap.addr);
>>       fb_dealloc_cmap(&info->cmap);
>>       framebuffer_release(info);
>
diff mbox series

Patch

diff --git a/drivers/video/fbdev/tridentfb.c b/drivers/video/fbdev/tridentfb.c
index f9c3b1d38fc2..7933e01aacc5 100644
--- a/drivers/video/fbdev/tridentfb.c
+++ b/drivers/video/fbdev/tridentfb.c
@@ -1475,7 +1475,7 @@  static int trident_pci_probe(struct pci_dev *dev,
 	if (err)
 		return err;
 
-	err = pci_enable_device(dev);
+	err = pcim_enable_device(dev);
 	if (err)
 		return err;
 
@@ -1715,12 +1715,10 @@  static int trident_pci_probe(struct pci_dev *dev,
 	kfree(info->pixmap.addr);
 	if (info->screen_base)
 		iounmap(info->screen_base);
-	release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
 	disable_mmio(info->par);
 out_unmap1:
 	if (default_par->io_virt)
 		iounmap(default_par->io_virt);
-	release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
 	framebuffer_release(info);
 	return err;
 }
@@ -1735,8 +1733,6 @@  static void trident_pci_remove(struct pci_dev *dev)
 		i2c_del_adapter(&par->ddc_adapter);
 	iounmap(par->io_virt);
 	iounmap(info->screen_base);
-	release_mem_region(tridentfb_fix.smem_start, tridentfb_fix.smem_len);
-	release_mem_region(tridentfb_fix.mmio_start, tridentfb_fix.mmio_len);
 	kfree(info->pixmap.addr);
 	fb_dealloc_cmap(&info->cmap);
 	framebuffer_release(info);