]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/shpchp_core.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / shpchp_core.c
index b64999d59f57ccdbb2cefd347691fae9c0beaf0a..80dec9796b3131161c8c4302a8e0b8eee7e7f8b3 100644 (file)
@@ -104,23 +104,6 @@ static void make_slot_name(struct slot *slot)
                 slot->bus, slot->number);
 }
 
-
-
-
-static int
-shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun,
-                               u8 busnum, u8 devnum)
-{
-       int offset = devnum - ctrl->slot_device_offset;
-
-       dbg("%s: ctrl->slot_num_inc %d, offset %d\n", __FUNCTION__,
-                       ctrl->slot_num_inc, offset);
-       *sun = (u8) (ctrl->first_slot + ctrl->slot_num_inc *offset);
-       return 0;
-}
-
-
-
 static int init_slots(struct controller *ctrl)
 {
        struct slot *slot;
@@ -128,7 +111,6 @@ static int init_slots(struct controller *ctrl)
        struct hotplug_slot_info *info;
        int retval = -ENOMEM;
        int i;
-       u32 sun;
 
        for (i = 0; i < ctrl->num_slots; i++) {
                slot = kzalloc(sizeof(*slot), GFP_KERNEL);
@@ -152,14 +134,9 @@ static int init_slots(struct controller *ctrl)
                slot->bus = ctrl->pci_dev->subordinate->number;
                slot->device = ctrl->slot_device_offset + i;
                slot->hpc_ops = ctrl->hpc_ops;
+               slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i);
                mutex_init(&slot->lock);
-
-               if (shpchprm_get_physical_slot_number(ctrl, &sun,
-                                                     slot->bus, slot->device))
-                       goto error_info;
-
-               slot->number = sun;
-               INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work);
+               INIT_DELAYED_WORK(&slot->work, shpchp_queue_pushbutton_work);
 
                /* register this slot with the hotplug pci core */
                hotplug_slot->private = slot;
@@ -216,7 +193,7 @@ void cleanup_slots(struct controller *ctrl)
  */
 static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -228,7 +205,7 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
 
 static int enable_slot (struct hotplug_slot *hotplug_slot)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -237,7 +214,7 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
 
 static int disable_slot (struct hotplug_slot *hotplug_slot)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
 
@@ -246,7 +223,7 @@ static int disable_slot (struct hotplug_slot *hotplug_slot)
 
 static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -260,7 +237,7 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
 
 static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -274,7 +251,7 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
 
 static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -288,7 +265,7 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
 
 static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -302,7 +279,7 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
 
 static int get_address (struct hotplug_slot *hotplug_slot, u32 *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        struct pci_bus *bus = slot->ctrl->pci_dev->subordinate;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -314,7 +291,7 @@ static int get_address (struct hotplug_slot *hotplug_slot, u32 *value)
 
 static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -328,7 +305,7 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
 
 static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)
 {
-       struct slot *slot = get_slot(hotplug_slot, __FUNCTION__);
+       struct slot *slot = get_slot(hotplug_slot);
        int retval;
 
        dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name);
@@ -378,7 +355,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        /* Setup the slot information structures */
        rc = init_slots(ctrl);
        if (rc) {
-               err(msg_initialization_err, 6);
+               err("%s: slot initialization failed\n", SHPC_MODULE_NAME);
                goto err_out_release_ctlr;
        }
 
@@ -424,10 +401,6 @@ static int __init shpcd_init(void)
 {
        int retval = 0;
 
-#ifdef CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE
-       shpchp_poll_mode = 1;
-#endif
-
        retval = pci_register_driver(&shpc_driver);
        dbg("%s: pci_register_driver = %d\n", __FUNCTION__, retval);
        info(DRIVER_DESC " version: " DRIVER_VERSION "\n");