All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase
Date: Fri, 20 Nov 2015 15:28:36 -0800	[thread overview]
Message-ID: <20151120232836.GC64635@google.com> (raw)
In-Reply-To: <5615780D.7050407@gmail.com>

On Wed, Oct 07, 2015 at 09:52:45PM +0200, Heiner Kallweit wrote:
> Return an error if spi_write fails.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/mtd/devices/m25p80.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> index 634b0c4..f10daa8 100644
> --- a/drivers/mtd/devices/m25p80.c
> +++ b/drivers/mtd/devices/m25p80.c
> @@ -171,9 +171,7 @@ static int m25p80_erase(struct spi_nor *nor, loff_t offset)
>  	flash->command[0] = nor->erase_opcode;
>  	m25p_addr2cmd(nor, offset, flash->command);
>  
> -	spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
> -
> -	return 0;
> +	return spi_write(flash->spi, flash->command, m25p_cmdsz(nor));
>  }
>  
>  /*

m25p80_erase() has been dropped, as it can be implemented in spi-nor.c,
with calls only to ->write_reg(). This error handling is done correctly
there. See:

cd78ea02dc82 ("mtd: m25p80: drop erase() callback")
c67cbb839da9 ("mtd: spi-nor: provide default erase_sector implementation")

Brian

  reply	other threads:[~2015-11-20 23:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07 19:52 [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase Heiner Kallweit
2015-11-20 23:28 ` Brian Norris [this message]
2015-11-29 11:18   ` Michal Suchanek
2015-11-29 11:34     ` Ezequiel Garcia
2015-11-29 13:15       ` Michal Suchanek

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=20151120232836.GC64635@google.com \
    --to=computersforpeace@gmail.com \
    --cc=hkallweit1@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.