diff options
author | Tejun Heo <htejun@gmail.com> | 2006-03-05 14:31:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-11 19:03:39 -0500 |
commit | ff8854b2719b9d26f5d3e84db4f66eb7e35e4ed9 (patch) | |
tree | 4db001403fc93b4c9620caa53efb7f9dec1105a6 /drivers/scsi/libata-core.c | |
parent | cb95d562e40140572efbca809f372e608aff7326 (diff) |
[PATCH] libata: use ata_id_xfermask() in ata_dev_configure()
Replace quick & dirty max transfer mode determination in
ata_dev_configure() with ata_id_xfermask(). While at it, rename
xfer_modes variable to xfer_mask and make it unsigned int for
consistency.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 9946618f1a35..84a8550c56a4 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1224,7 +1224,7 @@ static inline u8 ata_dev_knobble(const struct ata_port *ap, | |||
1224 | static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | 1224 | static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, |
1225 | int print_info) | 1225 | int print_info) |
1226 | { | 1226 | { |
1227 | unsigned long xfer_modes; | 1227 | unsigned int xfer_mask; |
1228 | int i, rc; | 1228 | int i, rc; |
1229 | 1229 | ||
1230 | if (!ata_dev_present(dev)) { | 1230 | if (!ata_dev_present(dev)) { |
@@ -1255,12 +1255,8 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1255 | goto err_out_nosup; | 1255 | goto err_out_nosup; |
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | /* quick-n-dirty find max transfer mode; for printk only */ | 1258 | /* find max transfer mode; for printk only */ |
1259 | xfer_modes = dev->id[ATA_ID_UDMA_MODES]; | 1259 | xfer_mask = ata_id_xfermask(dev->id); |
1260 | if (!xfer_modes) | ||
1261 | xfer_modes = (dev->id[ATA_ID_MWDMA_MODES]) << ATA_SHIFT_MWDMA; | ||
1262 | if (!xfer_modes) | ||
1263 | xfer_modes = ata_pio_modes(dev); | ||
1264 | 1260 | ||
1265 | ata_dump_id(dev->id); | 1261 | ata_dump_id(dev->id); |
1266 | 1262 | ||
@@ -1284,7 +1280,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1284 | "max %s, %Lu sectors: %s\n", | 1280 | "max %s, %Lu sectors: %s\n", |
1285 | ap->id, dev->devno, | 1281 | ap->id, dev->devno, |
1286 | ata_id_major_version(dev->id), | 1282 | ata_id_major_version(dev->id), |
1287 | ata_mode_string(xfer_modes), | 1283 | ata_mode_string(xfer_mask), |
1288 | (unsigned long long)dev->n_sectors, | 1284 | (unsigned long long)dev->n_sectors, |
1289 | lba_desc); | 1285 | lba_desc); |
1290 | } else { | 1286 | } else { |
@@ -1308,7 +1304,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1308 | "max %s, %Lu sectors: CHS %u/%u/%u\n", | 1304 | "max %s, %Lu sectors: CHS %u/%u/%u\n", |
1309 | ap->id, dev->devno, | 1305 | ap->id, dev->devno, |
1310 | ata_id_major_version(dev->id), | 1306 | ata_id_major_version(dev->id), |
1311 | ata_mode_string(xfer_modes), | 1307 | ata_mode_string(xfer_mask), |
1312 | (unsigned long long)dev->n_sectors, | 1308 | (unsigned long long)dev->n_sectors, |
1313 | dev->cylinders, dev->heads, dev->sectors); | 1309 | dev->cylinders, dev->heads, dev->sectors); |
1314 | } | 1310 | } |
@@ -1329,7 +1325,7 @@ static int ata_dev_configure(struct ata_port *ap, struct ata_device *dev, | |||
1329 | /* print device info to dmesg */ | 1325 | /* print device info to dmesg */ |
1330 | if (print_info) | 1326 | if (print_info) |
1331 | printk(KERN_INFO "ata%u: dev %u ATAPI, max %s\n", | 1327 | printk(KERN_INFO "ata%u: dev %u ATAPI, max %s\n", |
1332 | ap->id, dev->devno, ata_mode_string(xfer_modes)); | 1328 | ap->id, dev->devno, ata_mode_string(xfer_mask)); |
1333 | } | 1329 | } |
1334 | 1330 | ||
1335 | ap->host->max_cmd_len = 0; | 1331 | ap->host->max_cmd_len = 0; |