ChangeSet 1.1807.56.43, 2004/08/10 14:44:40-07:00, lxiep@us.ibm.com [PATCH] PCI Hotplug: rpaphp_get_power_level bug fix Recently I have run into the problem where I got the power-level "0" while I was expecting "100" from a slot that had pwered on. The attached patch fixes rpaphp_slot.c to use an int pointer(instead of an u8 pointer) when calling rtas_get_power_level routine. Signed-off-by: Linda Xie Signed-off-by: Greg Kroah-Hartman drivers/pci/hotplug/rpaphp_slot.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff -Nru a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c --- a/drivers/pci/hotplug/rpaphp_slot.c 2004-08-23 11:02:33 -07:00 +++ b/drivers/pci/hotplug/rpaphp_slot.c 2004-08-23 11:02:33 -07:00 @@ -244,7 +244,7 @@ int rpaphp_get_power_status(struct slot *slot, u8 * value) { - int rc = 0; + int rc = 0, level; if (slot->type == EMBEDDED) { dbg("%s set to POWER_ON for EMBEDDED slot %s\n", @@ -252,10 +252,14 @@ *value = POWER_ON; } else { - rc = rtas_get_power_level(slot->power_domain, (int *) value); - if (rc) + rc = rtas_get_power_level(slot->power_domain, &level); + if (!rc) { + dbg("%s the power level of slot %s(pwd-domain:0x%x) is %d\n", + __FUNCTION__, slot->name, slot->power_domain, level); + *value = level; + } else err("failed to get power-level for slot(%s), rc=0x%x\n", - slot->location, rc); + slot->location, rc); } return rc;