All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] drivers/char/mxser.c : change pci_find_device by
@ 2006-05-16 22:55 trem
  2006-05-17  0:17 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: trem @ 2006-05-16 22:55 UTC (permalink / raw)
  To: kernel-janitors

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

From: trem <tremyfr@yahoo.fr>

This patch simply change pci_find_device by pci_get_device, because
pci_find_device is deprecated. pci_dev_put has been added to decrement
the counter, so unload could be done.

Signed-Off-By: trem <tremyfr@yahoo.fr>
---


[-- Attachment #2: mxser_replace_pci_find_device_by_pci_get_device.patch --]
[-- Type: text/x-patch, Size: 1321 bytes --]

diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 0fb2fb9..82ccc31 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -817,7 +817,7 @@ static int mxser_init(void)
 	index = 0;
 	b = 0;
 	while (b < n) {
-		pdev = pci_find_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);
+		pdev = pci_get_device(mxser_pcibrds[b].vendor, mxser_pcibrds[b].device, pdev);
 			if (pdev == NULL) {
 			b++;
 			continue;
@@ -832,6 +832,7 @@ static int mxser_init(void)
 		} else {
 			if (pci_enable_device(pdev)) {
 				printk(KERN_ERR "Moxa SmartI/O PCI enable fail !\n");
+				pci_dev_put(pdev);
 				continue;
 			}
 			retval = mxser_get_PCI_conf(busnum, devnum, (int) mxser_pcibrds[b].driver_data, &hwconf);
@@ -844,15 +845,19 @@ static int mxser_init(void)
 					printk(KERN_ERR "Invalid interrupt vector,board not configured\n");
 				else if (retval == MXSER_ERR_IOADDR)
 					printk(KERN_ERR "Invalid I/O address,board not configured\n");
+				pci_dev_put(pdev);
 				continue;
 			}
 			mxser_getcfg(m, &hwconf);
 			//init mxsercfg first, or mxsercfg data is not correct on ISR.
 			//mxser_initbrd will hook ISR.
-			if (mxser_initbrd(m, &hwconf) < 0)
+			if (mxser_initbrd(m, &hwconf) < 0) {
+				pci_dev_put(pdev);
 				continue;
+			}
 			m++;
 		}
+		pci_dev_put(pdev);
 	}
 #endif
 

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

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

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

end of thread, other threads:[~2006-05-17  0:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 22:55 [KJ] [PATCH] drivers/char/mxser.c : change pci_find_device by trem
2006-05-17  0:17 ` Greg KH

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.