The spi_nor driver fails to build when the CONFIG_SPI_NOR_SFDP_RUNTIME option is enabled.
Here is the build error message:
drivers/flash/spi_nor.c: In function 'spi_nor_configure':
drivers/flash/spi_nor.c:1071:6: error: 'cfg' undeclared (first use in this function)
if (cfg->has_lock != 0) {