Skip to contentSkip to conversation

pci_find_device() in drivers/media/radio/

KJ Domen Puncer 2 participants 2 messages Feb 18, 2005 – Feb 19, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Sorry for late reply.

Quoted 7 lines · Christophe Lucas

Hi,

Description:

Quoted 4 lines

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

Patch per concept would be nice.

drivers/media/radio/radio-maestro.c static int __init maestro_radio_init(voi · line 268

Quoted 9 lines

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

drivers/media/radio/radio-maestro.c +1 -1
@@ -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, 

you could loose trailing whitespace ^

Quoted 17 lines
drivers/media/radio/radio-maestro.c +2 -1
 						  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);
@@ -316,6 +316,7 @@ static __u16 radio_install(struct pci_de
 	if(radio_power_on(&radio_unit)) {
 		if(video_register_device(&maestro_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
 			printk("radio-maestro: can't register device!");
+			pci_dev_put(pcidev);
 			return 0;
 		}
 		printk(KERN_INFO "radio-maestro: version "

drivers/media/radio/radio-maestro.c static __u16 radio_install(struct pci_de · line 331

Quoted 6 lines
drivers/media/radio/radio-maestro.c +2 -1
@@ -326,7 +327,9 @@ static __u16 radio_install(struct pci_de
 		       "\n");
 		printk(KERN_INFO "radio-maestro: radio chip initialized\n");
 		return 1;
-	} else
+	} else {
+		pci_dev_put(pcidev); 

ditto.

drivers/media/radio/radio-maestro.c static __u16 radio_install(struct pci_de · line 334

Quoted 3 lines
drivers/media/radio/radio-maestro.c +1 -0
 		return 0;   
+	}
 }

Whitespace is nitpicking. :-)
About pci_dev_put... it should probably also be in _exit paths, so module can be reinserted?

Comments?

Domen

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw
Quoted 5 lines · Domen Puncer

Sorry for late reply.

Quoted 2 lines · Christophe Lucas

Hi,

Quoted 7 lines
Quoted 5 lines

Description:

Quoted 4 lines

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

Patch per concept would be nice.

Yeah, afterwards, I have released patches by concept as you advise me here.

Quoted 1 line

Whitespace is nitpicking. :-)

I will pay attention on this. Thanks for all your comments. I am here to help and learn a lot from all of you.

Quoted 2 lines

About pci_dev_put... it should probably also be in _exit paths, so module can be reinserted?

You are right, I will soon released a patch that I hope correct.

Quoted 1 line

Comments?

Anymore comments, you are totally right.

~Christophe

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors