From: Sean Anderson Date: Tue, 15 Sep 2020 14:44:44 +0000 (-0400) Subject: mtd: spi-nand: Fix not calling dev_err with a device X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-favicon.png?a=commitdiff_plain;h=6dcc2819ae984ddbcdd63cee0a4319f150f46a9f;p=u-boot.git mtd: spi-nand: Fix not calling dev_err with a device Get it from spinand->slave->dev. Another option would be to use spinand_to_mtd(spinand)->dev, but this is what the existing code uses. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass Tested-by: Patrick Delaunay --- diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 93371fdde0..8c7e07d463 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -984,13 +984,13 @@ static int spinand_detect(struct spinand_device *spinand) ret = spinand_manufacturer_detect(spinand); if (ret) { - dev_err(dev, "unknown raw ID %*phN\n", SPINAND_MAX_ID_LEN, - spinand->id.data); + dev_err(spinand->slave->dev, "unknown raw ID %*phN\n", + SPINAND_MAX_ID_LEN, spinand->id.data); return ret; } if (nand->memorg.ntargets > 1 && !spinand->select_target) { - dev_err(dev, + dev_err(spinand->slave->dev, "SPI NANDs with more than one die must implement ->select_target()\n"); return -EINVAL; } @@ -1076,7 +1076,7 @@ static int spinand_init(struct spinand_device *spinand) ret = spinand_manufacturer_init(spinand); if (ret) { - dev_err(dev, + dev_err(spinand->slave->dev, "Failed to initialize the SPI NAND chip (err = %d)\n", ret); goto err_free_bufs;