From: Kristen Accardi Date: Fri, 5 Aug 2005 19:16:06 +0000 (-0700) Subject: [PATCH] PCI Hotplug: use bus_slot number for name X-Git-Tag: 2.1b_release~39784^2~21^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1248d636122e4ec9d7802b850904e3bb48a0da23;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git [PATCH] PCI Hotplug: use bus_slot number for name For systems with multiple hotplug controllers, you need to use more than just the slot number to uniquely name the slot. Without a unique slot name, the pci_hp_register() will fail. This patch adds the bus number to the name. Signed-off-by: Kristen Carlson Accardi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 2b92b9e..061ead2 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -302,7 +302,7 @@ static inline void return_resource(struct pci_resource **head, struct pci_resour static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot) { - snprintf(buffer, buffer_size, "%d", slot->number); + snprintf(buffer, buffer_size, "%04d_%04d", slot->bus, slot->number); } enum php_ctlr_type { diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h index fe4d653..b7d1c61 100644 --- a/drivers/pci/hotplug/shpchp.h +++ b/drivers/pci/hotplug/shpchp.h @@ -411,7 +411,7 @@ static inline void return_resource(struct pci_resource **head, struct pci_resour static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot) { - snprintf(buffer, buffer_size, "%d", slot->number); + snprintf(buffer, buffer_size, "%04d_%04d", slot->bus, slot->number); } enum php_ctlr_type {