Re: [PATCH 4/8] PCI hotplug: add pci_configure_slot()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 26 August 2009 11:00:28 pm Rolf Eike Beer wrote:
> Bjorn Helgaas wrote:
> > This patch adds a new pci_configure_slot() function that programs the
> > PCI bus characteristics for a newly-added device.  This is based on
> > code in pciehp_pci.c, but this should be generic enough to be used by
> > pciehp, shpchp, and acpiphp.
> 
> > diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
> > index 0f3e1db..8cff1d5 100644
> > --- a/include/linux/pci_hotplug.h
> > +++ b/include/linux/pci_hotplug.h
> > @@ -230,6 +230,10 @@ int acpi_get_hp_params(struct pci_dev *dev, struct
> > hotplug_params *hpp); int acpi_get_hp_hw_control_from_firmware(struct
> > pci_dev *dev, u32 flags); int acpi_pci_check_ejectable(struct pci_bus
> > *pbus, acpi_handle handle); int acpi_pci_detect_ejectable(struct pci_bus
> > *pbus);
> > +#else
> > +#define acpi_get_hp_params(dev, hpp)	(-ENODEV)
> 
> Shouldn't that be "static inline acpi_get_hp_params(...) { return -ENODEV; }" 
> so it behaves exactly like the original function (e.g. function pointer can be 
> taken)?

Thanks, Eike, that's a good point.  I copied the style from the
original pciehp_get_hp_params_from_firmware() definitions (which
my next patch removes), but it would be an improvement to use an
inline function.

It also occurred to me last night that pci_configure_slot() will
probably need to be exported, and that there's no need to check
"dev->is_pcie" before calling program_hpp_type2(), because we
bail out of program_hpp_type2() anyway if there's no PCI_CAP_ID_EXP.

I'll tidy up these bits and address any other issues, then post
a new series next week.

Bjorn

> >  #endif
> > +
> > +void pci_configure_slot(struct pci_dev *dev);
> >  #endif
> 
> Eike
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux