]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/rpaphp_slot.c
PCI: rpaphp: remove a function that does nothing but wrap debug printks
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / rpaphp_slot.c
index 3009193f005827965b79f099b730d040e70af5b4..9b940072798596cd09bc801838c2056c33ef2356 100644 (file)
@@ -56,7 +56,6 @@ static struct hotplug_slot_attribute php_attr_location = {
 static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot)
 {
        struct slot *slot = (struct slot *) hotplug_slot->private;
-
        dealloc_slot_struct(slot);
 }
 
@@ -65,12 +64,12 @@ void dealloc_slot_struct(struct slot *slot)
        kfree(slot->hotplug_slot->info);
        kfree(slot->hotplug_slot->name);
        kfree(slot->hotplug_slot);
+       kfree(slot->location);
        kfree(slot);
-       return;
 }
 
-struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name,
-                 int power_domain)
+struct slot *alloc_slot_struct(struct device_node *dn,
+                       int drc_index, char *drc_name, int power_domain)
 {
        struct slot *slot;
        
@@ -115,7 +114,7 @@ error_nomem:
 
 static int is_registered(struct slot *slot)
 {
-       struct slot             *tmp_slot;
+       struct slot *tmp_slot;
 
        list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) {
                if (!strcmp(tmp_slot->name, slot->name))
@@ -140,8 +139,6 @@ int rpaphp_deregister_slot(struct slot *slot)
        retval = pci_hp_deregister(php_slot);
        if (retval)
                err("Problem unregistering a slot %s\n", slot->name);
-       else
-               num_slots--;
 
        dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
        return retval;
@@ -160,14 +157,13 @@ int rpaphp_register_slot(struct slot *slot)
        /* should not try to register the same slot twice */
        if (is_registered(slot)) {
                err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
-               retval = -EAGAIN;
-               goto register_fail;
+               return -EAGAIN;
        }       
 
        retval = pci_hp_register(php_slot);
        if (retval) {
                err("pci_hp_register failed with error %d\n", retval);
-               goto register_fail;
+               return retval;
        }
 
        /* create "phy_location" file */
@@ -181,13 +177,10 @@ int rpaphp_register_slot(struct slot *slot)
        list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head);
        info("Slot [%s](PCI location=%s) registered\n", slot->name,
                        slot->location);
-       num_slots++;
        return 0;
 
 sysfs_fail:
        pci_hp_deregister(php_slot);
-register_fail:
-       rpaphp_release_slot(php_slot);
        return retval;
 }