[ create a new paste ] login | about

Link: http://codepad.org/VIwoXJRX    [ raw code | fork ]

Plain Text, pasted on Mar 24:
From bb6f0c0521fd37a6fb8f546ab2218d6d07bd3287 Mon Sep 17 00:00:00 2001
From: joe9 <joe9mail@gmail.com>
Date: Sat, 24 Mar 2012 13:07:19 -0400
Subject: [PATCH] changed pci_find_device to pci_get_device

pci_find_device is deprecated
---
 src/hal/drivers/hal_motenc.c |    2 +-
 src/hal/drivers/hal_vti.c    |    3 ++-
 src/hal/drivers/opto_ac5.c   |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/hal/drivers/hal_motenc.c b/src/hal/drivers/hal_motenc.c
index 9e80305..b64ed34 100644
--- a/src/hal/drivers/hal_motenc.c
+++ b/src/hal/drivers/hal_motenc.c
@@ -291,7 +291,7 @@ rtapi_app_main(void)
 
     i = 0;
     // Find a MOTENC card.
-    while((i < MAX_DEVICES) && ((pDev = pci_find_device(MOTENC_VENDOR_ID, MOTENC_DEVICE_ID, pDev)) != NULL)){
+    while((i < MAX_DEVICES) && ((pDev = pci_get_device(MOTENC_VENDOR_ID, MOTENC_DEVICE_ID, pDev)) != NULL)){
 
 	// Allocate memory for device object.
 	pDevice = hal_malloc(sizeof(Device));
diff --git a/src/hal/drivers/hal_vti.c b/src/hal/drivers/hal_vti.c
index 26d6002..f7ac0d3 100644
--- a/src/hal/drivers/hal_vti.c
+++ b/src/hal/drivers/hal_vti.c
@@ -822,8 +822,9 @@ static int vti_init_card()
 /* scans possible addresses for vti cards */
 static int vti_autodetect()
 {
-    dev = pci_find_device(VENDOR, DEVICE, dev);
+    dev = pci_get_device(VENDOR, DEVICE, dev);
     if (dev) {
+       pci_dev_put(dev);
 	rtapi_print_msg(RTAPI_MSG_INFO,
 	    "VTI: Card detected in slot: %2x\n", PCI_SLOT(dev->devfn));
 	return (0);
diff --git a/src/hal/drivers/opto_ac5.c b/src/hal/drivers/opto_ac5.c
index 1f3b2d5..9dcaedf 100644
--- a/src/hal/drivers/opto_ac5.c
+++ b/src/hal/drivers/opto_ac5.c
@@ -93,7 +93,7 @@ int rtapi_app_main(void)
     for ( n = 0 ; n < MAX_BOARDS ; n++ ) 
     {
 	// Find a M5I20 card.
-	pDev = pci_find_device(opto22_VENDOR_ID, opto22_pci_AC5_DEVICE_ID, pDev);
+	pDev = pci_get_device(opto22_VENDOR_ID, opto22_pci_AC5_DEVICE_ID, pDev);
 	if ( pDev == NULL ) { /* no more boards */break;}
 	
 
-- 
1.7.7.3




Create a new paste based on this one


Comments: