From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZjumI-0003Dp-7g for linux-mtd@lists.infradead.org; Wed, 07 Oct 2015 19:53:31 +0000 Received: by wicge5 with SMTP id ge5so228546025wic.0 for ; Wed, 07 Oct 2015 12:53:08 -0700 (PDT) To: Brian Norris Cc: linux-mtd@lists.infradead.org From: Heiner Kallweit Subject: [PATCH] mtd: m25p80: handle failed spi_write in m25p80_erase Message-ID: <5615780D.7050407@gmail.com> Date: Wed, 7 Oct 2015 21:52:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Return an error if spi_write fails. Signed-off-by: Heiner Kallweit --- 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)); } /* -- 2.6.1