diff mbox series

[v1,10/12] fastboot: check device type for SPI NAND too

Message ID 20231228153922.84323-11-avromanov@salutedevices.com
State Superseded
Delegated to: Dario Binacchi
Headers show
Series Support SPI NAND in fastboot protocol | expand

Commit Message

Alexey Romanov Dec. 28, 2023, 3:39 p.m. UTC
SPI NAND devices also supports 'fastboot erase / flash' commands.

Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
---
 drivers/fastboot/fb_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sean Anderson Dec. 28, 2023, 4:54 p.m. UTC | #1
On 12/28/23 10:39, Alexey Romanov wrote:
> SPI NAND devices also supports 'fastboot erase / flash' commands.
> 
> Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>
> ---
>  drivers/fastboot/fb_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
> index 6d3a900c77..39d888301f 100644
> --- a/drivers/fastboot/fb_nand.c
> +++ b/drivers/fastboot/fb_nand.c
> @@ -53,7 +53,7 @@ static int fb_nand_lookup(const char *partname,
>  		return ret;
>  	}
>  
> -	if (dev->id->type != MTD_DEV_TYPE_NAND) {
> +	if (dev->id->type != MTD_DEV_TYPE_NAND && dev->id->type != MTD_DEV_TYPE_SPINAND) {
>  		pr_err("partition '%s' is not stored on a NAND device",
>  		      partname);
>  		fastboot_fail("not a NAND device", response);

Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Mattijs Korpershoek Jan. 2, 2024, 1 p.m. UTC | #2
Hi Alexey,

Thank you for the patch.

On Thu, Dec 28, 2023 at 18:39, Alexey Romanov <avromanov@salutedevices.com> wrote:

> SPI NAND devices also supports 'fastboot erase / flash' commands.
>
> Signed-off-by: Alexey Romanov <avromanov@salutedevices.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/fastboot/fb_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
> index 6d3a900c77..39d888301f 100644
> --- a/drivers/fastboot/fb_nand.c
> +++ b/drivers/fastboot/fb_nand.c
> @@ -53,7 +53,7 @@ static int fb_nand_lookup(const char *partname,
>  		return ret;
>  	}
>  
> -	if (dev->id->type != MTD_DEV_TYPE_NAND) {
> +	if (dev->id->type != MTD_DEV_TYPE_NAND && dev->id->type != MTD_DEV_TYPE_SPINAND) {
>  		pr_err("partition '%s' is not stored on a NAND device",
>  		      partname);
>  		fastboot_fail("not a NAND device", response);
> -- 
> 2.30.1
diff mbox series

Patch

diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
index 6d3a900c77..39d888301f 100644
--- a/drivers/fastboot/fb_nand.c
+++ b/drivers/fastboot/fb_nand.c
@@ -53,7 +53,7 @@  static int fb_nand_lookup(const char *partname,
 		return ret;
 	}
 
-	if (dev->id->type != MTD_DEV_TYPE_NAND) {
+	if (dev->id->type != MTD_DEV_TYPE_NAND && dev->id->type != MTD_DEV_TYPE_SPINAND) {
 		pr_err("partition '%s' is not stored on a NAND device",
 		      partname);
 		fastboot_fail("not a NAND device", response);