aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 0d51d13b16bf..cf707029352e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1037,7 +1037,7 @@ static unsigned int ata_id_xfermask(const u16 *id)
1037 * the PIO timing number for the maximum. Turn it into 1037 * the PIO timing number for the maximum. Turn it into
1038 * a mask. 1038 * a mask.
1039 */ 1039 */
1040 u8 mode = id[ATA_ID_OLD_PIO_MODES] & 0xFF; 1040 u8 mode = (id[ATA_ID_OLD_PIO_MODES] >> 8) & 0xFF;
1041 if (mode < 5) /* Valid PIO range */ 1041 if (mode < 5) /* Valid PIO range */
1042 pio_mask = (2 << mode) - 1; 1042 pio_mask = (2 << mode) - 1;
1043 else 1043 else
@@ -2431,18 +2431,8 @@ int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev)
2431 int i, rc = 0, used_dma = 0, found = 0; 2431 int i, rc = 0, used_dma = 0, found = 0;
2432 2432
2433 /* has private set_mode? */ 2433 /* has private set_mode? */
2434 if (ap->ops->set_mode) { 2434 if (ap->ops->set_mode)
2435 /* FIXME: make ->set_mode handle no device case and 2435 return ap->ops->set_mode(ap, r_failed_dev);
2436 * return error code and failing device on failure.
2437 */
2438 for (i = 0; i < ATA_MAX_DEVICES; i++) {
2439 if (ata_dev_ready(&ap->device[i])) {
2440 ap->ops->set_mode(ap);
2441 break;
2442 }
2443 }
2444 return 0;
2445 }
2446 2436
2447 /* step 1: calculate xfer_mask */ 2437 /* step 1: calculate xfer_mask */
2448 for (i = 0; i < ATA_MAX_DEVICES; i++) { 2438 for (i = 0; i < ATA_MAX_DEVICES; i++) {