spi: flash: require manufacturer ID
This commit is contained in:
parent
84454c8054
commit
6defd2365c
1 changed files with 4 additions and 0 deletions
|
@ -170,6 +170,7 @@ static int spi_flash_erase(struct flash_dev *dev, uint32_t addr)
|
|||
|
||||
struct flash_dev *flash_probe(void)
|
||||
{
|
||||
char jedec_id[3] = { 0, 0, 0 };
|
||||
struct flash_dev *dev;
|
||||
|
||||
if (!(dev = malloc(sizeof *dev)))
|
||||
|
@ -181,6 +182,9 @@ struct flash_dev *flash_probe(void)
|
|||
dev->ops = &spi_flash_ops;
|
||||
dev->log2_block_size = ilog2(4 * KIB);
|
||||
|
||||
if (!spi_flash_get_jedec_id(dev, jedec_id, 3) || !jedec_id[0])
|
||||
goto err_free_dev;
|
||||
|
||||
return dev;
|
||||
|
||||
err_free_dev:
|
||||
|
|
Loading…
Add table
Reference in a new issue