diff options
author | Tejun Heo <htejun@gmail.com> | 2006-07-26 02:59:25 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-29 04:01:31 -0400 |
commit | d8fcd116d203dfe2f6c272d0cd67724b172f1bc2 (patch) | |
tree | 4b6c9cd5f50c754f5be053a2722162bd337e6534 /drivers/scsi/ahci.c | |
parent | 254950cd56fee220c9d548f3e57211b95976ba64 (diff) |
[PATCH] ahci: cosmetic changes to ahci_start/stop_engine()
* fascist-format comments according to comment style used in libata
core layer.
* if() -> if ()
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Zhao, Forrest <forrest.zhao@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/ahci.c')
-rw-r--r-- | drivers/scsi/ahci.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 92e2b950eff4..ee00aed9bdea 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -410,30 +410,23 @@ static int ahci_start_engine(void __iomem *port_mmio) | |||
410 | { | 410 | { |
411 | u32 tmp; | 411 | u32 tmp; |
412 | 412 | ||
413 | /* | 413 | /* get current status */ |
414 | * Get current status | ||
415 | */ | ||
416 | tmp = readl(port_mmio + PORT_CMD); | 414 | tmp = readl(port_mmio + PORT_CMD); |
417 | 415 | ||
418 | /* | 416 | /* AHCI rev 1.1 section 10.3.1: |
419 | * AHCI rev 1.1 section 10.3.1: | ||
420 | * Software shall not set PxCMD.ST to '1' until it verifies | 417 | * Software shall not set PxCMD.ST to '1' until it verifies |
421 | * that PxCMD.CR is '0' and has set PxCMD.FRE to '1' | 418 | * that PxCMD.CR is '0' and has set PxCMD.FRE to '1' |
422 | */ | 419 | */ |
423 | if ((tmp & PORT_CMD_FIS_RX) == 0) | 420 | if ((tmp & PORT_CMD_FIS_RX) == 0) |
424 | return -EPERM; | 421 | return -EPERM; |
425 | 422 | ||
426 | /* | 423 | /* wait for engine to become idle */ |
427 | * wait for engine to become idle. | ||
428 | */ | ||
429 | tmp = ata_wait_register(port_mmio + PORT_CMD, | 424 | tmp = ata_wait_register(port_mmio + PORT_CMD, |
430 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500); | 425 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500); |
431 | if(tmp & PORT_CMD_LIST_ON) | 426 | if (tmp & PORT_CMD_LIST_ON) |
432 | return -EBUSY; | 427 | return -EBUSY; |
433 | 428 | ||
434 | /* | 429 | /* start DMA */ |
435 | * Start DMA | ||
436 | */ | ||
437 | tmp |= PORT_CMD_START; | 430 | tmp |= PORT_CMD_START; |
438 | writel(tmp, port_mmio + PORT_CMD); | 431 | writel(tmp, port_mmio + PORT_CMD); |
439 | readl(port_mmio + PORT_CMD); /* flush */ | 432 | readl(port_mmio + PORT_CMD); /* flush */ |
@@ -447,20 +440,18 @@ static int ahci_stop_engine(void __iomem *port_mmio) | |||
447 | 440 | ||
448 | tmp = readl(port_mmio + PORT_CMD); | 441 | tmp = readl(port_mmio + PORT_CMD); |
449 | 442 | ||
450 | /* Check if the HBA is idle */ | 443 | /* check if the HBA is idle */ |
451 | if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) | 444 | if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) |
452 | return 0; | 445 | return 0; |
453 | 446 | ||
454 | /* Setting HBA to idle */ | 447 | /* setting HBA to idle */ |
455 | tmp &= ~PORT_CMD_START; | 448 | tmp &= ~PORT_CMD_START; |
456 | writel(tmp, port_mmio + PORT_CMD); | 449 | writel(tmp, port_mmio + PORT_CMD); |
457 | 450 | ||
458 | /* wait for engine to stop. This could be | 451 | /* wait for engine to stop. This could be as long as 500 msec */ |
459 | * as long as 500 msec | ||
460 | */ | ||
461 | tmp = ata_wait_register(port_mmio + PORT_CMD, | 452 | tmp = ata_wait_register(port_mmio + PORT_CMD, |
462 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); | 453 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); |
463 | if(tmp & PORT_CMD_LIST_ON) | 454 | if (tmp & PORT_CMD_LIST_ON) |
464 | return -EIO; | 455 | return -EIO; |
465 | 456 | ||
466 | return 0; | 457 | return 0; |