1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/mtd_spi_nor: check addr_width with assert()

This commit is contained in:
Benjamin Valentin 2020-11-02 21:07:51 +01:00
parent c839fe2e77
commit 98f88e849c

View File

@ -424,9 +424,9 @@ static int mtd_spi_nor_init(mtd_dev_t *mtd)
DEBUG("mtd_spi_nor_init: -> spi: %lx, cs: %lx, opcodes: %p\n",
(unsigned long)_get_spi(dev), (unsigned long)dev->params->cs, (void *)dev->params->opcode);
if (dev->params->addr_width == 0) {
return -EINVAL;
}
/* verify configuration */
assert(dev->params->addr_width > 0);
assert(dev->params->addr_width <= 4);
/* CS, WP, Hold */
_init_pins(dev);