mtd: spi-nor: Print all JEDEC ID bytes on error
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 12 Mar 2019 10:45:49 +0000 (11:45 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 21 Mar 2019 16:24:11 +0000 (17:24 +0100)
If identification of an SPI NOR FLASH fails, the JEDEC ID is printed,
which is stored in the first 3 bytes of the ID read from the FLASH.
However, the extended JEDEC ID, which is stored in the remaining bytes,
also matters, as it is used for identification of some FLASH types.

Print all (currently 6) ID bytes read to ease failure analysis and
debugging.

Suggested-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/spi-nor/spi-nor.c

index fae147452aff34994a7bd562c2bc74d97b5c4046..028b21abee0da5dc4d7fb460e67ce4ba6aad686a 100644 (file)
@@ -2071,8 +2071,8 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor)
                                return &spi_nor_ids[tmp];
                }
        }
-       dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n",
-               id[0], id[1], id[2]);
+       dev_err(nor->dev, "unrecognized JEDEC id bytes: %*ph\n",
+               SPI_NOR_MAX_ID_LEN, id);
        return ERR_PTR(-ENODEV);
 }