]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/pciehp_core.c
PCI: prevent duplicate slot names
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / pciehp_core.c
index 3ace5e057601f4b2cc64e6102903f0108a6f7e01..af89d7bd1edd5fb89c106f95f2b1374fb5ef0025 100644 (file)
@@ -196,7 +196,6 @@ static int init_slots(struct controller *ctrl)
        struct slot *slot;
        struct hotplug_slot *hotplug_slot;
        struct hotplug_slot_info *info;
-       int len, dup = 1;
        int retval = -ENOMEM;
 
        list_for_each_entry(slot, &ctrl->slot_list, slot_list) {
@@ -223,25 +222,11 @@ static int init_slots(struct controller *ctrl)
                ctrl_dbg(ctrl, "Registering bus=%x dev=%x hp_slot=%x sun=%x "
                         "slot_device_offset=%x\n", slot->bus, slot->device,
                         slot->hp_slot, slot->number, ctrl->slot_device_offset);
-duplicate_name:
                retval = pci_hp_register(hotplug_slot,
                                         ctrl->pci_dev->subordinate,
                                         slot->device,
                                         slot->name);
                if (retval) {
-                       /*
-                        * If slot N already exists, we'll try to create
-                        * slot N-1, N-2 ... N-M, until we overflow.
-                        */
-                       if (retval == -EEXIST) {
-                               len = snprintf(slot->name, SLOT_NAME_SIZE,
-                                              "%d-%d", slot->number, dup++);
-                               if (len < SLOT_NAME_SIZE)
-                                       goto duplicate_name;
-                               else
-                                       ctrl_err(ctrl, "duplicate slot name "
-                                                "overflow\n");
-                       }
                        ctrl_err(ctrl, "pci_hp_register failed with error %d\n",
                                 retval);
                        goto error_info;