Skip to content

Commit

Permalink
[PATCH] ahci: cosmetic changes to ahci_start/stop_engine()
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Jul 29, 2006
1 parent 254950c commit d8fcd11
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,30 +410,23 @@ static int ahci_start_engine(void __iomem *port_mmio)
{
u32 tmp;

/*
* Get current status
*/
/* get current status */
tmp = readl(port_mmio + PORT_CMD);

/*
* AHCI rev 1.1 section 10.3.1:
/* AHCI rev 1.1 section 10.3.1:
* Software shall not set PxCMD.ST to '1' until it verifies
* that PxCMD.CR is '0' and has set PxCMD.FRE to '1'
*/
if ((tmp & PORT_CMD_FIS_RX) == 0)
return -EPERM;

/*
* wait for engine to become idle.
*/
/* wait for engine to become idle */
tmp = ata_wait_register(port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500);
if(tmp & PORT_CMD_LIST_ON)
if (tmp & PORT_CMD_LIST_ON)
return -EBUSY;

/*
* Start DMA
*/
/* start DMA */
tmp |= PORT_CMD_START;
writel(tmp, port_mmio + PORT_CMD);
readl(port_mmio + PORT_CMD); /* flush */
Expand All @@ -447,20 +440,18 @@ static int ahci_stop_engine(void __iomem *port_mmio)

tmp = readl(port_mmio + PORT_CMD);

/* Check if the HBA is idle */
/* check if the HBA is idle */
if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0)
return 0;

/* Setting HBA to idle */
/* setting HBA to idle */
tmp &= ~PORT_CMD_START;
writel(tmp, port_mmio + PORT_CMD);

/* wait for engine to stop. This could be
* as long as 500 msec
*/
/* wait for engine to stop. This could be as long as 500 msec */
tmp = ata_wait_register(port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
if(tmp & PORT_CMD_LIST_ON)
if (tmp & PORT_CMD_LIST_ON)
return -EIO;

return 0;
Expand Down

0 comments on commit d8fcd11

Please sign in to comment.