[ide] pdc202xx_old: fix cable detection

pdc202xx_old_cable_detect() always returns '0' (which means 80c cable)
due to a sloppy coding - result of CIS & mask is truncated to 8 bits
although CIS holds cable info in bits 10-11.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 106167d2
......@@ -230,7 +230,7 @@ static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
{
u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10);
pci_read_config_word(hwif->pci_dev, 0x50, &CIS);
return ((u8)(CIS & mask));
return (CIS & mask) ? 1 : 0;
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment