Even if we know that we are going to fill everything later on
it's bad style and fragile to copy garbage from the stack to
the data structure that will be used in the driver.
Fixes:
fd307a4ad332 ("nvmem: prepare basics for FRAM support")
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211125212729.86585-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* Chip description */
if (!spi->dev.platform_data) {
- if (!is_fram) {
+ if (is_fram) {
+ /* We file fields for FRAM case later on */
+ memset(&chip, 0, sizeof(chip));
+ } else {
err = at25_fw_to_chip(&spi->dev, &chip);
if (err)
return err;