spi: flash: require manufacturer ID

tags/0.1.0
S.J.R. van Schaik 7 years ago
parent 84454c8054
commit 6defd2365c
  1. 4
      source/platform/spi_flash.c

@ -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…
Cancel
Save