From ddf151c22692e756e446303b79128f1d9b027eca Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 12 May 2014 21:42:06 -0600 Subject: [PATCH] A fix to the last MB85RS1MT patch --- drivers/mtd/ramtron.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/ramtron.c b/drivers/mtd/ramtron.c index 2ced81238cb..403867cd2e7 100644 --- a/drivers/mtd/ramtron.c +++ b/drivers/mtd/ramtron.c @@ -333,18 +333,23 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv) ramtron_lock(priv->dev); SPI_SELECT(priv->dev, SPIDEV_FLASH, true); - /* Send the "Read ID (RDID)" command and read the first three ID bytes */ + /* Send the "Read ID (RDID)" command */ (void)SPI_SEND(priv->dev, RAMTRON_RDID); + + /* Read the first six manufacturer ID bytes. */ + for (i = 0; i < 6; i++) { + /* Read the next manufacturer byte */ + manufacturer = SPI_SEND(priv->dev, RAMTRON_DUMMY); /* Fujitsu parts such as MB85RS1MT only have 1-byte for the manufacturer * ID. The manufacturer code is "0x4". */ - if (manufacturer == 0x04) + if (i == 0 && manufacturer == 0x04) { break; }