Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: rpaphp: remove rpaphp_set_attention_status()

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>

authored by

Linas Vepstas and committed by
Greg Kroah-Hartman
c02929c2 307ff12e

+10 -24
-1
drivers/pci/hotplug/rpaphp.h
··· 102 102 extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); 103 103 extern int rpaphp_register_slot(struct slot *slot); 104 104 extern int rpaphp_deregister_slot(struct slot *slot); 105 - extern int rpaphp_set_attention_status(struct slot *slot, u8 status); 106 105 107 106 #endif /* _PPC64PHP_H */
+10 -11
drivers/pci/hotplug/rpaphp_core.c
··· 63 63 */ 64 64 static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) 65 65 { 66 - int retval = 0; 66 + int rc; 67 67 struct slot *slot = (struct slot *)hotplug_slot->private; 68 68 69 69 down(&rpaphp_sem); 70 70 switch (value) { 71 71 case 0: 72 - retval = rpaphp_set_attention_status(slot, LED_OFF); 73 - hotplug_slot->info->attention_status = 0; 74 - break; 75 72 case 1: 76 - default: 77 - retval = rpaphp_set_attention_status(slot, LED_ON); 78 - hotplug_slot->info->attention_status = 1; 79 - break; 80 73 case 2: 81 - retval = rpaphp_set_attention_status(slot, LED_ID); 82 - hotplug_slot->info->attention_status = 2; 74 + break; 75 + default: 76 + value = 1; 83 77 break; 84 78 } 85 79 up(&rpaphp_sem); 86 - return retval; 80 + 81 + rc = rtas_set_indicator(DR_INDICATOR, slot->index, value); 82 + if (!rc) 83 + hotplug_slot->info->attention_status = value; 84 + 85 + return rc; 87 86 } 88 87 89 88 /**
-12
drivers/pci/hotplug/rpaphp_slot.c
··· 184 184 return retval; 185 185 } 186 186 187 - int rpaphp_set_attention_status(struct slot *slot, u8 status) 188 - { 189 - int rc; 190 - 191 - /* status: LED_OFF or LED_ON */ 192 - rc = rtas_set_indicator(DR_INDICATOR, slot->index, status); 193 - if (rc < 0) 194 - err("slot(name=%s location=%s index=0x%x) set attention-status(%d) failed! rc=0x%x\n", 195 - slot->name, slot->location, slot->index, status, rc); 196 - 197 - return rc; 198 - }