Skip to contentSkip to conversation

xgifb: change obsolete pci_find_device() with pci_get_device().

PATCH In review Atul Sowani 3 participants 4 messages Nov 2, 2010 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xgifb: change obsolete pci_find_device() with pci_get_device().

Replaced obsolete pci_find_device() calls with pci_get_device() calls. This is recommended in pci.txt filei in PCI Documentation.

---

drivers/staging/xgifb/XGI_main_26.c +1 -1
diff -uprN a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
@@ -483,7 +483,7 @@ XGIfb_query_VGA_config_space(struct xgi_
 			break;
 		}
 
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
+		pdev = pci_get_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
 		if (pdev)
 			valid_pdev = 1;
 	}
#1 lore raw
Quoted 2 lines · Atul Sowani

Replaced obsolete pci_find_device() calls with pci_get_device() calls. This is recommended in pci.txt filei in PCI Documentation.

Yes, but you just caused a resource leak :(

drivers/staging/xgifb/XGI_main_26.c XGIfb_query_VGA_config_space(struct xgi_ · line 486

Quoted 12 lines

---
diff -uprN a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c

drivers/staging/xgifb/XGI_main_26.c +1 -1
@@ -483,7 +483,7 @@ XGIfb_query_VGA_config_space(struct xgi_
 			break;
 		}
 
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
+		pdev = pci_get_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);

Please read the documentation for pci_get_device() for the fact that you now have a reference to the pci device. You need to properly drop it when finished.

Please change this patch to do that properly and I will be glad to apply it.

thanks,

greg k-h

#2 lore raw
In reply to Atul Sowani

Atul Sowani <[email protected]> writes:
Hi,

Quoted 9 lines

Replaced obsolete pci_find_device() calls with pci_get_device() calls. This is recommended in pci.txt filei in PCI Documentation.

---
diff -uprN a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c

drivers/staging/xgifb/XGI_main_26.c XGIfb_query_VGA_config_space(struct xgi_ · line 488

Quoted 7 lines
drivers/staging/xgifb/XGI_main_26.c +1 -1
@@ -483,7 +483,7 @@ XGIfb_query_VGA_config_space(struct xgi_
 			break;
 		}
 
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
+		pdev = pci_get_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
 		if (pdev)
 			valid_pdev = 1;

hmm... I guess that a pci_dev_put() call is lacking if it has been found.

Arnaud

#3 lore raw
Quoted 15 lines · Arnaud Patard

Atul Sowani <[email protected]> writes:
Hi,

Quoted 12 lines

Replaced obsolete pci_find_device() calls with pci_get_device() calls. This is recommended in pci.txt filei in PCI Documentation.

---
diff -uprN a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c

drivers/staging/xgifb/XGI_main_26.c +0 -0
@@ -483,7 +483,7 @@ XGIfb_query_VGA_config_space(struct xgi_
 			break;
 		}
 
Quoted 6 lines

drivers/staging/xgifb/XGI_main_26.c XGIfb_query_VGA_config_space(struct xgi_ · line 488

Quoted 4 lines
drivers/staging/xgifb/XGI_main_26.c +1 -1
-		pdev = pci_find_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
+		pdev = pci_get_device(PCI_VENDOR_ID_SI, nbridge_id, pdev);
 		if (pdev)
 			valid_pdev = 1;

hmm... I guess that a pci_dev_put() call is lacking if it has been found.

Exactly, that is what is needed here.

thanks,

greg k-h