Skip to content

Commit 466ee36

Browse files
Mike Habeckgregkh
authored andcommitted
[PATCH] 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 <habeck@sgi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 82d5f4a commit 466ee36

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/pci/hotplug/sgi_hotplug.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,12 @@ static inline int get_power_status(struct hotplug_slot *bss_hotplug_slot,
461461
{
462462
struct slot *slot = bss_hotplug_slot->private;
463463
struct pcibus_info *pcibus_info;
464+
u32 power;
464465

465466
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
466467
mutex_lock(&sn_hotplug_mutex);
467-
*value = pcibus_info->pbi_enabled_devices & (1 << slot->device_num);
468+
power = pcibus_info->pbi_enabled_devices & (1 << slot->device_num);
469+
*value = power ? 1 : 0;
468470
mutex_unlock(&sn_hotplug_mutex);
469471
return 0;
470472
}

0 commit comments

Comments
 (0)