Re: [PATCH] pci_find_device --> pci_get_device

From: Rolf Eike Beer
Date: Wed Jul 20 2005 - 08:55:28 EST


Jiri Slaby wrote:
>Rolf Eike Beer napsal(a):
>>Am Mittwoch, 20. Juli 2005 12:40 schrieb Jiri Slaby:
>>>Rolf Eike Beer napsal(a):
>>>>Your patch to arch/sparc64/kernel/ebus.c is broken, the removed and added
>>>>parts do not match in behaviour.
>>>
>>>I can't still see the difference.
>>
>>diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c
>>--- a/arch/sparc64/kernel/ebus.c
>>+++ b/arch/sparc64/kernel/ebus.c
>>@@ -527,8 +527,15 @@ static struct pci_dev *find_next_ebus(st
>> {
>> struct pci_dev *pdev = start;
>>
>>- do {
>>- pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev);
>>+ while (pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev))
>>+ if (pdev->device == PCI_DEVICE_ID_SUN_EBUS ||
>>+ pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)
>>+ break;
>>+ *is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS));
>>+
>>+/* do { // BEFORE \/ AFTER ^

This looks like some sed command went wrong. And I missed that you were
starting a comment here.

>Is there any difference? I don't see any, but... The reading of diff
>file in this case is not the best, maybe...

Yes, that was the problem. I would prefer if you could just remove the code
instead of commenting it out. This would have made this clearer.

If my editor doesn't fool me you are using spaces for indentation of the
while. There has to be a tab.

Question to the sparc folks: is it really needed to preserve the order of the
ebusses? Or would it be possible to do

pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS)

first and if this returns NULL start again with

pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_RIO_EBUS)

?

Eike

Attachment: pgp00000.pgp
Description: PGP signature