All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] pci_*() for drivers/media/radio/
@ 2005-02-02  8:23 Christophe Lucas
  2005-02-02 10:26 ` Domen Puncer
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lucas @ 2005-02-02  8:23 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

Hi,

Description:
From : http://kerneljanitors.org/TODO
>- delete all pci_find_* functions from the kernel tree.
>  Instead of pci_find_device use pci_get_device()..
>-  convert from pci_module_init to pci_register_driver

Signed-off-by: Christophe Lucas <c.lucas@ifrance.com>
-- 
Christophe

[-- Attachment #2: pci_drivers_media_radio.patch --]
[-- Type: text/plain, Size: 2128 bytes --]

diff -urpN -X /work/users/dontdiff linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-gemtek-pci.c linux-2.6.11-rc2/drivers/media/radio/radio-gemtek-pci.c
--- linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-gemtek-pci.c	2005-01-26 08:31:14.000000000 +0100
+++ linux-2.6.11-rc2/drivers/media/radio/radio-gemtek-pci.c	2005-01-26 10:01:19.000000000 +0100
@@ -394,7 +394,7 @@ static struct pci_driver gemtek_pci_driv
 
 static int __init gemtek_pci_init_module( void )
 {
-	return pci_module_init( &gemtek_pci_driver );
+	return pci_register_driver( &gemtek_pci_driver );
 }
 
 static void __exit gemtek_pci_cleanup_module( void )
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c
--- linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c	2005-01-26 08:31:14.000000000 +0100
+++ linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c	2005-01-26 10:30:27.000000000 +0100
@@ -265,11 +265,11 @@ static int __init maestro_radio_init(voi
 {
 	register __u16 found=0;
 	struct pci_dev *pcidev = NULL;
-	while(!found && (pcidev = pci_find_device(PCI_VENDOR_ESS, 
+	while(!found && (pcidev = pci_get_device(PCI_VENDOR_ESS, 
 						  PCI_DEVICE_ID_ESS_ESS1968,
 						  pcidev)))
 		found |= radio_install(pcidev);
-	while(!found && (pcidev = pci_find_device(PCI_VENDOR_ESS,
+	while(!found && (pcidev = pci_get_device(PCI_VENDOR_ESS,
 						  PCI_DEVICE_ID_ESS_ESS1978, 
 						  pcidev)))
 		found |= radio_install(pcidev);
diff -urpN -X /work/users/dontdiff linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maxiradio.c linux-2.6.11-rc2/drivers/media/radio/radio-maxiradio.c
--- linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maxiradio.c	2005-01-26 08:31:14.000000000 +0100
+++ linux-2.6.11-rc2/drivers/media/radio/radio-maxiradio.c	2005-01-26 10:01:28.000000000 +0100
@@ -337,7 +337,7 @@ static struct pci_driver maxiradio_drive
 
 static int __init maxiradio_radio_init(void)
 {
-	return pci_module_init(&maxiradio_driver);
+	return pci_register_driver(&maxiradio_driver);
 }
 
 static void __exit maxiradio_radio_exit(void)

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH] pci_*() for drivers/media/radio/
  2005-02-02  8:23 [KJ] [PATCH] pci_*() for drivers/media/radio/ Christophe Lucas
@ 2005-02-02 10:26 ` Domen Puncer
  0 siblings, 0 replies; 2+ messages in thread
From: Domen Puncer @ 2005-02-02 10:26 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

On 02/02/05 09:23 +0100, Christophe Lucas wrote:
> Hi,
> 
> Description:
> >From : http://kerneljanitors.org/TODO
> >- delete all pci_find_* functions from the kernel tree.
> >  Instead of pci_find_device use pci_get_device()..
> >-  convert from pci_module_init to pci_register_driver
> 
> Signed-off-by: Christophe Lucas <c.lucas@ifrance.com>
> -- 
> Christophe
...

> diff -urpN -X /work/users/dontdiff linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c
> --- linux-2.6.11-rc2-vanilla/drivers/media/radio/radio-maestro.c	2005-01-26 08:31:14.000000000 +0100
> +++ linux-2.6.11-rc2/drivers/media/radio/radio-maestro.c	2005-01-26 10:30:27.000000000 +0100
> @@ -265,11 +265,11 @@ static int __init maestro_radio_init(voi
>  {
>  	register __u16 found=0;
>  	struct pci_dev *pcidev = NULL;
> -	while(!found && (pcidev = pci_find_device(PCI_VENDOR_ESS, 
> +	while(!found && (pcidev = pci_get_device(PCI_VENDOR_ESS, 
>  						  PCI_DEVICE_ID_ESS_ESS1968,
>  						  pcidev)))

I recall from Hanna Linder patches that this is not a search and replace,
pci_get_device implements refcounting, so you have to put (pci_dev_put?)
on error and exit paths.


	Domen

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-02-02 10:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02  8:23 [KJ] [PATCH] pci_*() for drivers/media/radio/ Christophe Lucas
2005-02-02 10:26 ` Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.