From habeck@sgi.com Sat May 6 07:02:11 2006 Date: Sat, 6 May 2006 09:01:59 -0500 (CDT) From: Mike Habeck Cc: gregkh@suse.de, habeck@sgi.com, Mike Habeck Message-Id: <20060506140159.10694.57720.75984@attica.americas.sgi.com> Subject: SGI Hotplug: Incorrect power status This is a repost of a patch submitted by Prarit Bhargava on 01-19-06 that never got integrated. The get_power_status function is currently reporting a bitwise mapping of the slot if the slot is powered on. It should return 1 if powered on and 0 if powered off. Signed-off-by: Mike Habeck Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/sgi_hotplug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/pci/hotplug/sgi_hotplug.c +++ gregkh-2.6/drivers/pci/hotplug/sgi_hotplug.c @@ -461,10 +461,12 @@ static inline int get_power_status(struc { struct slot *slot = bss_hotplug_slot->private; struct pcibus_info *pcibus_info; + u32 power; pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); mutex_lock(&sn_hotplug_mutex); - *value = pcibus_info->pbi_enabled_devices & (1 << slot->device_num); + power = pcibus_info->pbi_enabled_devices & (1 << slot->device_num); + *value = power ? 1 : 0; mutex_unlock(&sn_hotplug_mutex); return 0; }