Skip to content

Commit

Permalink
mtd: spinand: Fix display of unknown raw ID
Browse files Browse the repository at this point in the history
In case ID is not found in manufacturer table, the raw ID is
printed using %*phN format which is not supported by lib/vsprintf.c.
The information displayed doesn't reflect the raw ID return by the
unknown spi-nand.

Use %02x format instead, as done in spi-nor-core.c.

For example, before this patch:
  ERROR: spi-nand: spi_nand flash@0: unknown raw ID f74ec040
after
  ERROR: spi-nand: spi_nand flash@0: unknown raw ID 00 c2 26 03

Fixes: 0a6d6ba ("mtd: nand: Add core infrastructure to support SPI NANDs")

Signed-off-by: Patrice Chotard <[email protected]>
Reviewed-by: Frieder Schrempf <[email protected]>
Acked-by: Michael Trimarchi <[email protected]>
Signed-off-by: Dario Binacchi <[email protected]>
  • Loading branch information
Patrice Chotard authored and passgat committed Feb 27, 2023
1 parent d346971 commit 4f64a31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/mtd/nand/spi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,8 +979,9 @@ static int spinand_detect(struct spinand_device *spinand)

ret = spinand_manufacturer_detect(spinand);
if (ret) {
dev_err(spinand->slave->dev, "unknown raw ID %*phN\n",
SPINAND_MAX_ID_LEN, spinand->id.data);
dev_err(spinand->slave->dev, "unknown raw ID %02x %02x %02x %02x\n",
spinand->id.data[0], spinand->id.data[1],
spinand->id.data[2], spinand->id.data[3]);
return ret;
}

Expand Down

0 comments on commit 4f64a31

Please sign in to comment.