Skip to contentSkip to conversation

mtd: m25p80: fixup device removal failure path

PATCH In review Brian Norris 2 participants 3 messages Oct 30, 2013 – Oct 31, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: m25p80: fixup device removal failure path

Device removal shouls fail if MTD unregistration fails.

---
 drivers/mtd/devices/m25p80.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +1 -3
index 58978892c321..7eda71dbc183 100644
@@ -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);
 }
 
 
Signature · 1 line
1.8.1.2
Reviewed-by on v1 1/1
#1 lore raw

Dear Brian Norris,

Quoted 1 line

Device removal shouls fail if MTD unregistration fails.

should ;-)

Quoted 11 lines
---
 drivers/mtd/devices/m25p80.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +0 -0
index 58978892c321..7eda71dbc183 100644

drivers/mtd/devices/m25p80.c static int m25p_remove(struct spi_device *spi) · line 1129

Quoted 8 lines
drivers/mtd/devices/m25p80.c +1 -3
@@ -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);
 }

Best regards,
Marek Vasut

#2 lore raw
Quoted 3 lines · Marek Vasut
Quoted 1 line

Device removal shouls fail if MTD unregistration fails.

should ;-)

Wow... I need to proofread myself a bit better. Thanks.

Quoted 1 line

Fixed and pushed to l2-mtd.git.

Brian