[PATCH v17 4/7] mtd: spi-nor: core: Return error code from set_4byte_addr_mode()
Pratyush Yadav
p.yadav at ti.com
Tue Jul 26 02:26:38 PDT 2022
On 25/07/22 12:25PM, Tudor Ambarus wrote:
> From: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
>
> The prams->set_4byte_addr_mode returns error code but is not handled
> in spi_nor_init(). Handle the return code from set_4byte_addr_mode().
>
> Suggested-by: Michael Walle <michael at walle.cc>
> Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano at infineon.com>
> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>
Reviewed-by: Pratyush Yadav <p.yadav at ti.com>
You could also add a print if this returns an error in
spi_nor_restore(), but that can be a separate patch.
> ---
> drivers/mtd/spi-nor/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
> index 9f07f1036151..ec4c368b4ba6 100644
> --- a/drivers/mtd/spi-nor/core.c
> +++ b/drivers/mtd/spi-nor/core.c
> @@ -2724,7 +2724,7 @@ static int spi_nor_init(struct spi_nor *nor)
> */
> WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
> "enabling reset hack; may not recover from unexpected reboots\n");
> - nor->params->set_4byte_addr_mode(nor, true);
> + return nor->params->set_4byte_addr_mode(nor, true);
> }
>
> return 0;
> --
> 2.25.1
>
--
Regards,
Pratyush Yadav
Texas Instruments Inc.
More information about the linux-mtd
mailing list