Message ID | 65962791-e8ca-ac64-9bc0-1de8f19d94d2@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | cmd: Ensure sf operates on spi flash | expand |
diff --git a/cmd/sf.c b/cmd/sf.c index e993b3e5ad..21a410c40f 100644 --- a/cmd/sf.c +++ b/cmd/sf.c @@ -132,6 +132,10 @@ static int do_spi_flash_probe(int argc, char * const argv[]) printf("Failed to initialize SPI flash at %u:%u (error %d)\n", bus, cs, ret); return 1; + } else if (new->driver->id != UCLASS_SPI_FLASH) { + printf("SPI device is not SPI flash: uclass is %d, expected %d\n", + new->driver->id, UCLASS_SPU_FLASH); + return 1; } flash = dev_get_uclass_priv(new);