public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Nicholas Mc Guire <hofrat@osadl.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>,
	linux-kernel@vger.kernel.org, Huang Shijie <b32955@freescale.com>,
	linux-mtd@lists.infradead.org,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: nand: gpmi: fixup return type of wait_for_completion_timeout
Date: Sun, 8 Feb 2015 18:58:50 +0100	[thread overview]
Message-ID: <20150208185850.750af67d@bbrezillon> (raw)
In-Reply-To: <1423413453-5254-1-git-send-email-hofrat@osadl.org>

On Sun,  8 Feb 2015 11:37:33 -0500
Nicholas Mc Guire <hofrat@osadl.org> wrote:

> return type of wait_for_completion_timeout is unsigned long not int. The
> return variable is renamed to reflect its use and the type adjusted to
> unsigned long.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
> 
> Patch was only compile tested with imx_v6_v7_defconfig
> (implies CONFIG_MTD_NAND_GPMI_NAND=y)
> 
> Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)
> 
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 33f3c3c..6e44d32 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -446,7 +446,7 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this,
>  				struct dma_async_tx_descriptor *desc)
>  {
>  	struct completion *dma_c = &this->dma_done;
> -	int err;
> +	unsigned long timeout;
>  
>  	init_completion(dma_c);
>  
> @@ -456,8 +456,8 @@ int start_dma_without_bch_irq(struct gpmi_nand_data *this,
>  	dma_async_issue_pending(get_dma_chan(this));
>  
>  	/* Wait for the interrupt from the DMA block. */
> -	err = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000));
> -	if (!err) {
> +	timeout = wait_for_completion_timeout(dma_c, msecs_to_jiffies(1000));
> +	if (!timeout) {
>  		dev_err(this->dev, "DMA timeout, last DMA :%d\n",
>  			this->last_dma_type);
>  		gpmi_dump_info(this);
> @@ -477,7 +477,7 @@ int start_dma_with_bch_irq(struct gpmi_nand_data *this,
>  			struct dma_async_tx_descriptor *desc)
>  {
>  	struct completion *bch_c = &this->bch_done;
> -	int err;
> +	unsigned long timeout;
>  
>  	/* Prepare to receive an interrupt from the BCH block. */
>  	init_completion(bch_c);
> @@ -486,8 +486,8 @@ int start_dma_with_bch_irq(struct gpmi_nand_data *this,
>  	start_dma_without_bch_irq(this, desc);
>  
>  	/* Wait for the interrupt from the BCH block. */
> -	err = wait_for_completion_timeout(bch_c, msecs_to_jiffies(1000));
> -	if (!err) {
> +	timeout = wait_for_completion_timeout(bch_c, msecs_to_jiffies(1000));
> +	if (!timeout) {
>  		dev_err(this->dev, "BCH timeout, last DMA :%d\n",
>  			this->last_dma_type);
>  		gpmi_dump_info(this);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2015-02-08 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 16:37 [PATCH] mtd: nand: gpmi: fixup return type of wait_for_completion_timeout Nicholas Mc Guire
2015-02-08 17:58 ` Boris Brezillon [this message]
2015-02-10  4:01 ` Huang Shijie
2015-03-31  1:13 ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150208185850.750af67d@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=b32955@freescale.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=fabio.estevam@freescale.com \
    --cc=hofrat@osadl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox