]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/shpchp_core.c
PCI: prevent duplicate slot names
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / shpchp_core.c
index bf5096612aaba9b33ab055fc9c7d2964b6f23aa6..cfdd07963641be9f16e2fee9e7af68368a22b3f5 100644 (file)
@@ -102,7 +102,7 @@ static int init_slots(struct controller *ctrl)
        struct hotplug_slot *hotplug_slot;
        struct hotplug_slot_info *info;
        int retval = -ENOMEM;
-       int i, len, dup = 1;
+       int i;
 
        for (i = 0; i < ctrl->num_slots; i++) {
                slot = kzalloc(sizeof(*slot), GFP_KERNEL);
@@ -144,23 +144,10 @@ static int init_slots(struct controller *ctrl)
                dbg("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(slot->hotplug_slot,
                                ctrl->pci_dev->subordinate, slot->device,
                                hotplug_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
-                                       err("duplicate slot name overflow\n");
-                       }
                        err("pci_hp_register failed with error %d\n", retval);
                        goto error_info;
                }