From: Brian Norris Date: Sun, 27 Oct 2013 22:42:12 +0000 (-0700) Subject: mtd: m25p80: fixup device removal failure path X-Git-Tag: v3.13-rc1~98^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9650b9bec61d861b6b59d09eb389410b05d196e4;p=thirdparty%2Fkernel%2Flinux.git mtd: m25p80: fixup device removal failure path Device removal should fail if MTD unregistration fails. Signed-off-by: Brian Norris Reviewed-by: Marek Vasut --- diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 58978892c3210..7eda71dbc183b 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); }