[PATCH] mtd: m25p80: fixup device removal failure path

Marek Vasut marex at denx.de
Thu Oct 31 00:36:36 PDT 2013


Dear Brian Norris,

> Device removal shouls fail if MTD unregistration fails.

should ;-)

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

> 
> Signed-off-by: Brian Norris <computersforpeace at 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



More information about the linux-mtd mailing list