mtd: fsl-quadspi: cleanup wait_for_completion return handling

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Apr 22 10:59:06 PDT 2015


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=219a8d13dd2bd0536e359405d046bdce9cc9d134
Commit:     219a8d13dd2bd0536e359405d046bdce9cc9d134
Parent:     dc6525c61f0fc1e41611d91134f56ed2c297feac
Author:     Nicholas Mc Guire <hofrat at osadl.org>
AuthorDate: Sun Feb 1 06:15:46 2015 -0500
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 30 18:08:04 2015 -0700

    mtd: fsl-quadspi: cleanup wait_for_completion return handling
    
    return type of wait_for_completion_timeout is unsigned long not int, this
    patch uses the return value of wait_for_completion_timeout in the condition
    directly rather than adding a additional appropriately typed variable.
    
    Signed-off-by: Nicholas Mc Guire <hofrat at osadl.org>
    Acked-by: Han Xu <han.xu at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/spi-nor/fsl-quadspi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
index c01dd16..5d5d362 100644
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -460,8 +460,7 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len)
 	writel((seqid << QUADSPI_IPCR_SEQID_SHIFT) | len, base + QUADSPI_IPCR);
 
 	/* Wait for the interrupt. */
-	err = wait_for_completion_timeout(&q->c, msecs_to_jiffies(1000));
-	if (!err) {
+	if (!wait_for_completion_timeout(&q->c, msecs_to_jiffies(1000))) {
 		dev_err(q->dev,
 			"cmd 0x%.2x timeout, addr@%.8x, FR:0x%.8x, SR:0x%.8x\n",
 			cmd, addr, readl(base + QUADSPI_FR),



More information about the linux-mtd-cvs mailing list