Skip to contentSkip to conversation

libata: replace ap->cbl tests with ATA_FLAG_SATA tests

PATCH Applied Tejun Heo 3 participants 3 messages May 21, 2007 – May 25, 2007 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata: replace ap->cbl tests with ATA_FLAG_SATA tests

ap->cbl == ATA_CBL_SATA indicates SATA cable while ap->flags & ATA_FLAG_SATA indicates SATA host port. Till now they always gave the same result but SATA/PATA bridge handling will change that. Switch to ATA_FLAG_SATA test if we're testing for host port type.

---
 libata-core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/libata-core.c +3 -3
index d5939e6..da322d4 100644
@@ -3364,7 +3364,7 @@ int ata_std_prereset(struct ata_port *ap
 		return 0;
 
 	/* if SATA, resume phy */
-	if (ap->cbl == ATA_CBL_SATA) {
+	if (ap->flags & ATA_FLAG_SATA) {
 		rc = sata_phy_resume(ap, timing, deadline);
 		/* whine about phy resume failure but proceed */
 		if (rc && rc != -EOPNOTSUPP)
@@ -5678,7 +5678,7 @@ irqreturn_t ata_interrupt (int irq, void
  */
 int sata_scr_valid(struct ata_port *ap)
 {
-	return ap->cbl == ATA_CBL_SATA && ap->ops->scr_read;
+	return (ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read;
 }
 
 /**
@@ -6341,7 +6341,7 @@ int ata_host_register(struct ata_host *h
 		if (!ata_port_is_dummy(ap))
 			ata_port_printk(ap, KERN_INFO, "%cATA max %s cmd 0x%p "
 					"ctl 0x%p bmdma 0x%p irq %d\n",
-					ap->cbl == ATA_CBL_SATA ? 'S' : 'P',
+					(ap->flags & ATA_FLAG_SATA) ? 'S' : 'P',
 					ata_mode_string(xfer_mask),
 					ap->ioaddr.cmd_addr,
 					ap->ioaddr.ctl_addr,
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Mon, 21 May 2007 18:33:47 +0200 Tejun Heo <[email protected]> wrote:

ap->cbl == ATA_CBL_SATA indicates SATA cable while ap->flags & ATA_FLAG_SATA indicates SATA host port. Till now they always gave the same result but SATA/PATA bridge handling will change that. Switch to ATA_FLAG_SATA test if we're testing for host port type.

Applied
#2 lore raw
In reply to Tejun Heo
Quoted 10 lines · Tejun Heo

ap->cbl == ATA_CBL_SATA indicates SATA cable while ap->flags & ATA_FLAG_SATA indicates SATA host port. Till now they always gave the same result but SATA/PATA bridge handling will change that. Switch to ATA_FLAG_SATA test if we're testing for host port type.

---
 libata-core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

applied