Skip to content

Commit

Permalink
[PATCH] SGI Hotplug: Incorrect power status
Browse files Browse the repository at this point in the history
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 <habeck@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mike Habeck authored and Greg Kroah-Hartman committed Jun 19, 2006
1 parent 82d5f4a commit 466ee36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/hotplug/sgi_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,12 @@ static inline int get_power_status(struct hotplug_slot *bss_hotplug_slot,
{
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;
}
Expand Down

0 comments on commit 466ee36

Please sign in to comment.