
4 Feb
2020
4 Feb
'20
11:49 a.m.
Hi Sean,
On Mon, Jan 20, 2020 at 7:13 AM Sean Anderson seanga2@gmail.com wrote:
Currently, the sf command will probe anything attached to an spi bus, regardless of whether it is UCLASS_SPI_FLASH. This came up when testing the mmc_spi driver,
Did you do something like:
=> sf probe 1 0
?
which is accessed via spi but is UCLASS_MMC. If the uclass is not what sf expects, then the "flash" variable will not actually have type spi_nor. This patch adds a check so we don't clobber any data if the user requests us to probe a device which is not an spi flash.
Signed-off-by: Sean Anderson seanga2@gmail.com
Changes for v2: Fixed Signed-off-by line Fix typo (SPU_FLASH -> SPI_FLASH)
cmd/sf.c | 4 ++++ 1 file changed, 4 insertions(+)
Reviewed-by: Bin Meng bmeng.cn@gmail.com
Regards, Bin