summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/rpaphp_core.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-04-13 15:34:14 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 19:02:39 -0700
commitbf0af511fcc856649a2a39c627828695b580d124 (patch)
treef921e091364da84b19741e9054600695491a9707 /drivers/pci/hotplug/rpaphp_core.c
parent427310ff02e80cc80826407c0121cec3694c9e7d (diff)
PCI: rpaphp: Remove another wrappered function
Remove another stove-pipe; this funcion was called from two different places, with a compile-time const that is then run-time checked to perform two different things. 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>
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_core.c')
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 2d919fb1931c..cab7cee65741 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -130,12 +130,22 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value)
{
struct slot *slot = (struct slot *)hotplug_slot->private;
- int retval = 0;
+ int rc, state;
down(&rpaphp_sem);
- retval = rpaphp_get_pci_adapter_status(slot, 0, value);
+ rc = rpaphp_get_sensor_state(slot, &state);
up(&rpaphp_sem);
- return retval;
+
+ *value = NOT_VALID;
+ if (rc)
+ return rc;
+
+ if (state == EMPTY)
+ *value = EMPTY;
+ else if (state == PRESENT)
+ *value = slot->state;
+
+ return 0;
}
static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value)