Am Mittwoch, 26. April 2006 00:00 schrieb Kristen Accardi: >On Tue, 2006-04-25 at 08:16 +0200, Arjan van de Ven wrote: >> On Mon, 2006-04-24 at 15:50 -0700, Kristen Accardi wrote: >> > Don't call pci_enable_device from pciehp because the pcie port service >> > driver already does this. >> >> hmmmm shouldn't pci_enable_device on a previously enabled device just >> succeed? Sounds more than logical to me to make it that way at least... > >I can't think of any reason why not. Something like this what you had >in mind perhaps? > >--- > drivers/pci/pci.c | 14 +++++++++----- > 1 files changed, 9 insertions(+), 5 deletions(-) > >--- 2.6-git-pcie.orig/drivers/pci/pci.c >+++ 2.6-git-pcie/drivers/pci/pci.c >@@ -504,11 +504,15 @@ pci_enable_device_bars(struct pci_dev *d > int > pci_enable_device(struct pci_dev *dev) > { >- int err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); >- if (err) >- return err; >- pci_fixup_device(pci_fixup_enable, dev); >- dev->is_enabled = 1; >+ int err; >+ >+ if (!dev->is_enabled) { >+ err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); >+ if (err) >+ return err; >+ pci_fixup_device(pci_fixup_enable, dev); >+ dev->is_enabled = 1; >+ } > return 0; > } What about if (dev->is_enabled) return 0; and leaving the rest as it is? This would save one level of identation. Opinions? Eike
Attachment:
pgpAp6IOhwypv.pgp
Description: PGP signature
- References:
- [patch] pciehp: dont call pci_enable_dev
- From: Kristen Accardi <[email protected]>
- Re: [patch] pciehp: dont call pci_enable_dev
- From: Arjan van de Ven <[email protected]>
- Re: [patch] pciehp: dont call pci_enable_dev
- From: Kristen Accardi <[email protected]>
- [patch] pciehp: dont call pci_enable_dev
- Prev by Date: Re: PCI ROM resource allocation issue with 2.6.17-rc2
- Next by Date: Re: PCI ERROR: Segmentation fault in pci_do_scan_bus
- Previous by thread: Re: [patch] pciehp: dont call pci_enable_dev
- Next by thread: Re: [patch] pciehp: dont call pci_enable_dev
- Index(es):