Skip to contentSkip to conversation

replace deprecated pci_find_device

KJ Stephan Sperber 3 participants 3 messages Aug 21, 2006 – Aug 22, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello everybody!
The included patch is my first try, so be critical :)
On the TODO list is mentioned that pci_find_device should be replaced with pci_get_dev. It also mentions that after shutting down the device a pci_dev_put(*dev) is needed to free the used memory again. And here is the problem I have. I don't see a "shutdownfunction" in ip2main.c nor in the other ip2 related files. Or did I miss something?

Thank you for any input on this topic.

Stephan

drivers/char/ip2/ip2main.c +1 -1
index 7907ae8..11b4f25 100644
@@ -589,7 +589,7 @@ ip2_loadmain(int *iop, int *irqp, unsign
 #ifdef CONFIG_PCI
 			{
 				struct pci_dev *pci_dev_i = NULL;
-				pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
+				pci_dev_i = pci_get_device(PCI_VENDOR_ID_COMPUTONE,
 							  PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
 				if (pci_dev_i != NULL) {
 					unsigned int addr;

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

#1 lore raw

with begin of august Patrik Kullman <[email protected]> posted a bunch of patches for replacing pci_find_device->pci_get_device
make sure you do not duplicate that work. read the comments posted by others about that subject.

re,
walter

Quoted 25 lines · Stephan Sperber

Hello everybody!
The included patch is my first try, so be critical :)
On the TODO list is mentioned that pci_find_device should be replaced with pci_get_dev. It also mentions that after shutting down the device a pci_dev_put(*dev) is needed to free the used memory again. And here is the problem I have. I don't see a "shutdownfunction" in ip2main.c nor in the other ip2 related files. Or did I miss something?

Thank you for any input on this topic.

Stephan

drivers/char/ip2/ip2main.c +1 -1
index 7907ae8..11b4f25 100644
@@ -589,7 +589,7 @@ ip2_loadmain(int *iop, int *irqp, unsign
 #ifdef CONFIG_PCI
 			{
 				struct pci_dev *pci_dev_i = NULL;
-				pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
+				pci_dev_i = pci_get_device(PCI_VENDOR_ID_COMPUTONE,
 							  PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
 				if (pci_dev_i != NULL) {
 					unsigned int addr;
Quoted 7 lines

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

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

#2 lore raw
In reply to Stephan Sperber

Hi

I see a function named "cleanup_module" with some code to free pci board. I think that 'pci_dev_put' could be added there. Be carreful, it's just a proposition.

By the way, last time I've tried to do such change (pci_find_device -> pci_get_device),
gkh answers me to use new PCI driver model (pci_register_driver). I don't kown if
it should be done here too.

trem

Quoted 25 lines · Stephan Sperber

Hello everybody!
The included patch is my first try, so be critical :)
On the TODO list is mentioned that pci_find_device should be replaced with pci_get_dev. It also mentions that after shutting down the device a pci_dev_put(*dev) is needed to free the used memory again. And here is the problem I have. I don't see a "shutdownfunction" in ip2main.c nor in the other ip2 related files. Or did I miss something?

Thank you for any input on this topic.

Stephan

drivers/char/ip2/ip2main.c +1 -1
index 7907ae8..11b4f25 100644
@@ -589,7 +589,7 @@ ip2_loadmain(int *iop, int *irqp, unsign
 #ifdef CONFIG_PCI
 			{
 				struct pci_dev *pci_dev_i = NULL;
-				pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
+				pci_dev_i = pci_get_device(PCI_VENDOR_ID_COMPUTONE,
 							  PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
 				if (pci_dev_i != NULL) {
 					unsigned int addr;
Quoted 6 lines

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

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