From b09c74f66d46fac7f25e53a0c06f832cf0638a5c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 10 Mar 2021 18:23:57 +0100 Subject: mtd: spi_flash_free() dfu_free_entities() invoking dfu_free_entity_sf() has let to segementation faults due to double freeing the same device. spi_flash_free() is not relevant for the driver model but exists only for compatibility with old drivers. We must not remove any device here: * The device may still be referenced. * We don't want to have to probe again. Signed-off-by: Heinrich Schuchardt --- include/spi_flash.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/spi_flash.h') diff --git a/include/spi_flash.h b/include/spi_flash.h index 85cae32cc7..478c543b06 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -97,7 +97,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, unsigned int max_hz, unsigned int spi_mode); /* Compatibility function - this is the old U-Boot API */ -void spi_flash_free(struct spi_flash *flash); +static inline void spi_flash_free(struct spi_flash *flash) +{ +} static inline int spi_flash_read(struct spi_flash *flash, u32 offset, size_t len, void *buf) -- cgit v1.2.3