From 7e89c104824bb8f6dc5b786d085d4e6aaf156342 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Thu, 18 Dec 2014 15:56:36 -0800 Subject: [PATCH] spi: Do not die() if flash chip is probed multiple times It turns out that it's not uncommon for a SPI chip to be probed multiple times in different parts of the code during the execution of a stage. The original intent was just to make sure we aren't using the same chip driver for multiple instances of a chip, due to limitations in the driver's design. We'll have a better solution for that eventually, this just un-breaks things (and effectively reverts 5da9e0e). BUG=chrome-os-partner:34750 BRANCH=none TEST=none Signed-off-by: David Hendricks Change-Id: Ie5c6e7f062a2f7c5361aebf5a4ab62a385739f65 Reviewed-on: https://chromium-review.googlesource.com/236673 Reviewed-by: Julius Werner (cherry picked from commit 0438927fa2469311b20e032377275100eee6e3a6) Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/237026 --- src/drivers/spi/gigadevice.c | 3 --- src/drivers/spi/winbond.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/drivers/spi/gigadevice.c b/src/drivers/spi/gigadevice.c index 42ac0d8e47..ad5d470e91 100644 --- a/src/drivers/spi/gigadevice.c +++ b/src/drivers/spi/gigadevice.c @@ -203,9 +203,6 @@ struct spi_flash *spi_flash_probe_gigadevice(struct spi_slave *spi, u8 *idcode) unsigned page_size; unsigned int i; - if (stm.params) - die("Gigadevice driver already initialized."); - for (i = 0; i < ARRAY_SIZE(gigadevice_spi_flash_table); i++) { params = &gigadevice_spi_flash_table[i]; if (params->id == ((idcode[1] << 8) | idcode[2])) diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c index d4f61df480..a0abeb4ef0 100644 --- a/src/drivers/spi/winbond.c +++ b/src/drivers/spi/winbond.c @@ -192,9 +192,6 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode) unsigned page_size; unsigned int i; - if (stm.params) - die("Winbond driver already initialized."); - for (i = 0; i < ARRAY_SIZE(winbond_spi_flash_table); i++) { params = &winbond_spi_flash_table[i]; if (params->id == ((idcode[1] << 8) | idcode[2]))