mtd: m25p80: fixup device removal failure path

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Nov 13 13:59:06 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9650b9bec61d861b6b59d09eb389410b05d196e4
Commit:     9650b9bec61d861b6b59d09eb389410b05d196e4
Parent:     d367e37e004ca6847d5503781d218a266e8bc1ef
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sun Oct 27 15:42:12 2013 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 6 23:33:14 2013 -0800

    mtd: m25p80: fixup device removal failure path
    
    Device removal should fail if MTD unregistration fails.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Reviewed-by: Marek Vasut <marex at denx.de>
---
 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 5897889..7eda71d 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -1125,9 +1125,7 @@ static int m25p_remove(struct spi_device *spi)
 	struct m25p	*flash = spi_get_drvdata(spi);
 
 	/* Clean up MTD stuff. */
-	mtd_device_unregister(&flash->mtd);
-
-	return 0;
+	return mtd_device_unregister(&flash->mtd);
 }
 
 



More information about the linux-mtd-cvs mailing list