Skip to contentSkip to conversation

convert

PATCH In review Tobias Klauser 4 participants 4 messages Sep 30, 2004

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

PATCH 1/1 convert

I'm sending this only to kernel-janitor since I'm not sure, if I do this right (It's my first patch). It compiled without problems here.

Description: Use pci_get_device instead of pci_find_device.

drivers/atm/fore200e.c 2004-09-30 10:41:20.368794120 +0200 renamed from drivers/atm/fore200e.c 2004-09-30 10:24:43.000000000 +0200 +1 -1
diff -Nrup linux-2.6.9-rc2-mm4-vanilla/drivers/atm/fore200e.c linux-2.6.9-rc2-mm4/drivers/atm/fore200e.c
@@ -644,7 +644,7 @@ fore200e_pca_detect(const struct fore200
     int              count = index;
 
     do {
-       pci_dev = pci_find_device(PCI_VENDOR_ID_FORE, PCI_DEVICE_ID_FORE_PCA200E, pci_dev);
+       pci_dev = pci_get_device(PCI_VENDOR_ID_FORE, PCI_DEVICE_ID_FORE_PCA200E, pci_dev);
        if (pci_dev == NULL)
            return NULL;
     } while (count--);

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

#1 lore raw
Quoted 4 lines · Tobias Klauser

I'm sending this only to kernel-janitor since I'm not sure, if I do this right (It's my first patch). It compiled without problems here.

Description: Use pci_get_device instead of pci_find_device.

Sorry, but the original code really wants a rewrite to use pci_driver.

It's broken to no end, and pci_get_device won't fix the races.

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

#2 lore raw
In reply to Tobias Klauser
Quoted 4 lines · Tobias Klauser

I'm sending this only to kernel-janitor since I'm not sure, if I do this right (It's my first patch). It compiled without problems here.

Description: Use pci_get_device instead of pci_find_device.

You can't just replace pci_find_device() with pci_get_device(). Otherwise it'd all be much simpler. You must understand what the code is doing, and figure out what needs to be done to be hotplug safe. You need to read Documentation/pci.txt and understand it.

Quoted 19 lines

10:24:43.000000000 +0200
+++ linux-2.6.9-rc2-mm4/drivers/atm/fore200e.c 2004-09-30 10:41:20.368794120 +0200

drivers/atm/fore200e.c 2004-09-30 10:41:20.368794120 +0200 renamed from drivers/atm/fore200e.c 2004-09-30 10:24:43.000000000 +0200 +1 -1
@@ -644,7 +644,7 @@ fore200e_pca_detect(const struct fore200
     int              count = index;
 
     do {
-       pci_dev = pci_find_device(PCI_VENDOR_ID_FORE, 
 PCI_DEVICE_ID_FORE_PCA200E, pci_dev);
+       pci_dev = pci_get_device(PCI_VENDOR_ID_FORE, 
 PCI_DEVICE_ID_FORE_PCA200E, pci_dev);
        if (pci_dev == NULL)
            return NULL;
     } while (count--);

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

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain

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

#3 lore raw
In reply to Tobias Klauser
Quoted 11 lines · Tobias Klauser

I'm sending this only to kernel-janitor since I'm not sure, if I do this right (It's my first patch). It compiled without problems here.

Description: Use pci_get_device instead of pci_find_device.

diff -Nrup linux-2.6.9-rc2-mm4-vanilla/drivers/atm/fore200e.c linux-2.6.9-rc2-mm4/drivers/atm/fore200e.c
--- linux-2.6.9-rc2-mm4-vanilla/drivers/atm/fore200e.c 2004-09-30 10:24:43.000000000 +0200

Becides the other errors mentioned in the patch, it is also linewrapped and can't be applied :(

thanks,

greg k-h

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