]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi-nand: Fix not calling dev_err with a device
authorSean Anderson <seanga2@gmail.com>
Tue, 15 Sep 2020 14:44:44 +0000 (10:44 -0400)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 12:52:44 +0000 (08:52 -0400)
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 <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/mtd/nand/spi/core.c

index 93371fdde071dd6bfe33536ec443fb63c32f1cf8..8c7e07d46304842be78e88985da0ff50bde597bd 100644 (file)
@@ -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;