diff mbox

mtd: m25p80: fixup device removal failure path

Message ID 1383176571-28057-1-git-send-email-computersforpeace@gmail.com
State Accepted
Commit 9650b9bec61d861b6b59d09eb389410b05d196e4
Headers show

Commit Message

Brian Norris Oct. 30, 2013, 11:42 p.m. UTC
Device removal shouls fail if MTD unregistration fails.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/devices/m25p80.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Marek Vasut Oct. 31, 2013, 7:36 a.m. UTC | #1
Dear Brian Norris,

> Device removal shouls fail if MTD unregistration fails.

should ;-)

Reviewed-by: Marek Vasut <marex@denx.de>

> 
> Signed-off-by: Brian Norris <computersforpeace@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 58978892c321..7eda71dbc183 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);
>  }

Best regards,
Marek Vasut
Brian Norris Oct. 31, 2013, 2:27 p.m. UTC | #2
On Thu, Oct 31, 2013 at 3:36 AM, Marek Vasut <marex@denx.de> wrote:
>> Device removal shouls fail if MTD unregistration fails.
>
> should ;-)

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

> Reviewed-by: Marek Vasut <marex@denx.de>

Fixed and pushed to l2-mtd.git.

Brian
diff mbox

Patch

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 58978892c321..7eda71dbc183 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);
 }