PCI: rpaphp: remove rpaphp_set_attention_status()
authorLinas Vepstas <linas@austin.ibm.com>
Fri, 13 Apr 2007 22:34:18 +0000 (15:34 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 May 2007 02:02:39 +0000 (19:02 -0700)
The rpaphp_set_attention_status() routine seems to be a wrapper
around a single rtas call. Abolish it.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: John Rose <johnrose@austin.ibm.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/hotplug/rpaphp.h
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/hotplug/rpaphp_slot.c

index a2b22575cf77f6424f0fb620f3497bf1ec43b50f..e28e93cd00fd75dd610144192f0b55e3a1f002f2 100644 (file)
@@ -102,6 +102,5 @@ extern void dealloc_slot_struct(struct slot *slot);
 extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
 extern int rpaphp_register_slot(struct slot *slot);
 extern int rpaphp_deregister_slot(struct slot *slot);
-extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
        
 #endif                         /* _PPC64PHP_H */
index 3970cacc0b868ef59c1dc811fd3131f5f64c9dbe..e9c157d30e824bd739eb9d61eac5fdbd742e9f6c 100644 (file)
@@ -63,27 +63,26 @@ module_param(debug, bool, 0644);
  */
 static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
 {
-       int retval = 0;
+       int rc;
        struct slot *slot = (struct slot *)hotplug_slot->private;
 
        down(&rpaphp_sem);
        switch (value) {
        case 0:
-               retval = rpaphp_set_attention_status(slot, LED_OFF);
-               hotplug_slot->info->attention_status = 0;
-               break;
        case 1:
-       default:
-               retval = rpaphp_set_attention_status(slot, LED_ON);
-               hotplug_slot->info->attention_status = 1;
-               break;
        case 2:
-               retval = rpaphp_set_attention_status(slot, LED_ID);
-               hotplug_slot->info->attention_status = 2;
+               break;
+       default:
+               value = 1;
                break;
        }
        up(&rpaphp_sem);
-       return retval;
+
+       rc = rtas_set_indicator(DR_INDICATOR, slot->index, value);
+       if (!rc)
+               hotplug_slot->info->attention_status = value;
+
+       return rc;
 }
 
 /**
index 30c9dc98e4ecf6a1ad0e18bc0884ea9600bc6e06..d4ee8723fcb3d6f609b2ac24570e3464648280cd 100644 (file)
@@ -184,15 +184,3 @@ sysfs_fail:
        return retval;
 }
 
-int rpaphp_set_attention_status(struct slot *slot, u8 status)
-{
-       int rc;
-
-       /* status: LED_OFF or LED_ON */
-       rc = rtas_set_indicator(DR_INDICATOR, slot->index, status);
-       if (rc < 0)
-               err("slot(name=%s location=%s index=0x%x) set attention-status(%d) failed! rc=0x%x\n",
-                   slot->name, slot->location, slot->index, status, rc);
-
-       return rc;
-}