diff options
| author | Tom Rini <trini@konsulko.com> | 2020-10-05 13:05:46 -0400 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2020-10-05 14:10:59 -0400 |
| commit | b7e7831e5d5be047f421ddc1f308afc22764a893 (patch) | |
| tree | 7d5f27c82b260278ed0b3ea96bce592b0505b898 /drivers/mtd/spi | |
| parent | 050acee119b3757fee3bd128f55d720fdd9bb890 (diff) | |
| parent | caebff09efe8c061b4d99b82262c67fb2db9bbcf (diff) | |
| download | u-boot-b7e7831e5d5be047f421ddc1f308afc22764a893.tar.gz u-boot-b7e7831e5d5be047f421ddc1f308afc22764a893.tar.xz u-boot-b7e7831e5d5be047f421ddc1f308afc22764a893.zip | |
Merge branch 'next'
Bring in the assorted changes that have been staged in the 'next' branch
prior to release.
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/mtd/spi')
| -rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 1 | ||||
| -rw-r--r-- | drivers/mtd/spi/spi-nor-tiny.c | 21 |
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 0113e70037..e16b0e1462 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -11,6 +11,7 @@ #include <common.h> #include <log.h> +#include <dm.h> #include <dm/device_compat.h> #include <dm/devres.h> #include <linux/bitops.h> diff --git a/drivers/mtd/spi/spi-nor-tiny.c b/drivers/mtd/spi/spi-nor-tiny.c index fa26ea33c8..07c8c7b82b 100644 --- a/drivers/mtd/spi/spi-nor-tiny.c +++ b/drivers/mtd/spi/spi-nor-tiny.c @@ -55,9 +55,19 @@ static int spi_nor_read_reg(struct spi_nor *nor, u8 code, u8 *val, int len) int ret; ret = spi_nor_read_write_reg(nor, &op, val); - if (ret < 0) - dev_dbg(&flash->spimem->spi->dev, "error %d reading %x\n", ret, + if (ret < 0) { + /* + * spi_slave does not have a struct udevice member without DM, + * so use the bus and cs instead. + */ +#if CONFIG_IS_ENABLED(DM_SPI) + dev_dbg(nor->spi->dev, "error %d reading %x\n", ret, code); +#else + log_debug("spi%u.%u: error %d reading %x\n", + nor->spi->bus, nor->spi->cs, ret, code); +#endif + } return ret; } @@ -512,7 +522,8 @@ static int spansion_read_cr_quad_enable(struct spi_nor *nor) /* Check current Quad Enable bit value. */ ret = read_cr(nor); if (ret < 0) { - dev_dbg(dev, "error while reading configuration register\n"); + dev_dbg(nor->dev, + "error while reading configuration register\n"); return -EINVAL; } @@ -524,7 +535,7 @@ static int spansion_read_cr_quad_enable(struct spi_nor *nor) /* Keep the current value of the Status Register. */ ret = read_sr(nor); if (ret < 0) { - dev_dbg(dev, "error while reading status register\n"); + dev_dbg(nor->dev, "error while reading status register\n"); return -EINVAL; } sr_cr[0] = ret; @@ -785,7 +796,7 @@ int spi_nor_scan(struct spi_nor *nor) } if (nor->addr_width > SPI_NOR_MAX_ADDR_WIDTH) { - dev_dbg(dev, "address width is too large: %u\n", + dev_dbg(nor->dev, "address width is too large: %u\n", nor->addr_width); return -EINVAL; } |
