vserver 1.9.5.x5
[linux-2.6.git] / drivers / pci / hotplug / rpaphp_slot.c
index c58541a..2bbd87e 100644 (file)
@@ -244,18 +244,21 @@ int register_slot(struct slot *slot)
 
 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",
-                       __FUNCTION__, slot->location);
-               *value = POWER_ON;
-       }
-       else {
-               rc = rtas_get_power_level(slot->power_domain, (int *) value);
-               if (rc)
+       if (slot->type == HOTPLUG) {
+               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);
+       } else {
+               dbg("%s report POWER_ON for EMBEDDED or PHB slot %s\n",
+                       __FUNCTION__, slot->location);
+               *value = (u8) POWER_ON;
        }
 
        return rc;