From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 04/46] mtd: nand: pxa3xx: Fix not calling dev_xxx with a device
Date: Tue, 15 Sep 2020 10:44:40 -0400 [thread overview]
Message-ID: <20200915144522.509493-5-seanga2@gmail.com> (raw)
In-Reply-To: <20200915144522.509493-1-seanga2@gmail.com>
Use the device from any mtd already available, or from the active mtd via
pxa3xx_nand_info if one is not.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
Changes in v2:
- New
drivers/mtd/nand/raw/pxa3xx_nand.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/mtd/nand/raw/pxa3xx_nand.c b/drivers/mtd/nand/raw/pxa3xx_nand.c
index a30e82166b..5fb3081c83 100644
--- a/drivers/mtd/nand/raw/pxa3xx_nand.c
+++ b/drivers/mtd/nand/raw/pxa3xx_nand.c
@@ -512,7 +512,7 @@ static int pxa3xx_nand_init_timings(struct pxa3xx_nand_host *host)
}
if (i == ntypes) {
- dev_err(&info->pdev->dev, "Error: timings not found\n");
+ dev_err(mtd->dev, "Error: timings not found\n");
return -EINVAL;
}
@@ -603,7 +603,7 @@ static void drain_fifo(struct pxa3xx_nand_info *info, void *data, int len)
ts = get_timer(0);
while (!(nand_readl(info, NDSR) & NDSR_RDDREQ)) {
if (get_timer(ts) > TIMEOUT_DRAIN_FIFO) {
- dev_err(&info->pdev->dev,
+ dev_err(info->controller.active->mtd.dev,
"Timeout on RDDREQ while draining the FIFO\n");
return;
}
@@ -656,8 +656,8 @@ static void handle_data_pio(struct pxa3xx_nand_info *info)
DIV_ROUND_UP(info->step_spare_size, 4));
break;
default:
- dev_err(&info->pdev->dev, "%s: invalid state %d\n", __func__,
- info->state);
+ dev_err(info->controller.active->mtd.dev,
+ "%s: invalid state %d\n", __func__, info->state);
BUG();
}
@@ -1027,7 +1027,7 @@ static int prepare_set_command(struct pxa3xx_nand_info *info, int command,
default:
exec_cmd = 0;
- dev_err(&info->pdev->dev, "non-supported command %x\n",
+ dev_err(mtd->dev, "non-supported command %x\n",
command);
break;
}
@@ -1087,7 +1087,7 @@ static void nand_cmdfunc(struct mtd_info *mtd, unsigned command,
break;
if (get_timer(ts) > CHIP_DELAY_TIMEOUT) {
- dev_err(&info->pdev->dev, "Wait timeout!!!\n");
+ dev_err(mtd->dev, "Wait timeout!!!\n");
return;
}
}
@@ -1180,7 +1180,7 @@ static void nand_cmdfunc_extended(struct mtd_info *mtd,
break;
if (get_timer(ts) > CHIP_DELAY_TIMEOUT) {
- dev_err(&info->pdev->dev, "Wait timeout!!!\n");
+ dev_err(mtd->dev, "Wait timeout!!!\n");
return;
}
}
@@ -1426,7 +1426,7 @@ static int pxa3xx_nand_waitfunc(struct mtd_info *mtd, struct nand_chip *this)
break;
if (get_timer(ts) > CHIP_DELAY_TIMEOUT) {
- dev_err(&info->pdev->dev, "Ready timeout!!!\n");
+ dev_err(mtd->dev, "Ready timeout!!!\n");
return NAND_STATUS_FAIL;
}
}
@@ -1633,7 +1633,7 @@ static int pxa_ecc_init(struct pxa3xx_nand_info *info,
ecc->strength = 16;
} else {
- dev_err(&info->pdev->dev,
+ dev_err(info->controller.active->mtd.dev,
"ECC strength %d at page size %d is not supported\n",
strength, page_size);
return -ENODEV;
@@ -1659,8 +1659,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
return ret;
ret = pxa3xx_nand_sensing(host);
if (ret) {
- dev_info(&info->pdev->dev,
- "There is no chip on cs %d!\n",
+ dev_info(mtd->dev, "There is no chip on cs %d!\n",
info->cs);
return ret;
}
@@ -1676,7 +1675,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
if (!pdata->keep_config) {
ret = pxa3xx_nand_init_timings(host);
if (ret) {
- dev_err(&info->pdev->dev,
+ dev_err(mtd->dev,
"Failed to set timings: %d\n", ret);
return ret;
}
@@ -1720,7 +1719,7 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370) {
chip->cmdfunc = nand_cmdfunc_extended;
} else {
- dev_err(&info->pdev->dev,
+ dev_err(mtd->dev,
"unsupported page size on this variant\n");
return -ENODEV;
}
@@ -1873,6 +1872,7 @@ static int pxa3xx_nand_probe_dt(struct pxa3xx_nand_info *info)
static int pxa3xx_nand_probe(struct pxa3xx_nand_info *info)
{
+ struct mtd_info *mtd = &info->controller.active->mtd;
struct pxa3xx_nand_platform_data *pdata;
int ret, cs, probe_success;
@@ -1884,7 +1884,7 @@ static int pxa3xx_nand_probe(struct pxa3xx_nand_info *info)
ret = alloc_nand_resource(info);
if (ret) {
- dev_err(&pdev->dev, "alloc nand resource failed\n");
+ dev_err(mtd->dev, "alloc nand resource failed\n");
return ret;
}
@@ -1901,7 +1901,7 @@ static int pxa3xx_nand_probe(struct pxa3xx_nand_info *info)
info->cs = cs;
ret = pxa3xx_nand_scan(mtd);
if (ret) {
- dev_info(&pdev->dev, "failed to scan nand at cs %d\n",
+ dev_info(mtd->dev, "failed to scan nand at cs %d\n",
cs);
continue;
}
--
2.28.0
next prev parent reply other threads:[~2020-09-15 14:44 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 14:44 [PATCH v2 00/46] dm: Print device name in dev_xxx like Linux Sean Anderson
2020-09-15 14:44 ` [PATCH v2 01/46] dm: syscon: Fix calling dev_dbg with an uninitialized device Sean Anderson
2020-09-16 12:44 ` Patrick DELAUNAY
2020-09-16 12:51 ` Sean Anderson
2020-09-15 14:44 ` [PATCH v2 02/46] firmware: ti_sci: Fix not calling dev_err with a device Sean Anderson
2020-09-16 1:26 ` Nishanth Menon
2020-09-15 14:44 ` [PATCH v2 03/46] i2c: mxc: Fix dev_err being called on a nonexistant variable Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-17 7:50 ` Heiko Schocher
2020-09-15 14:44 ` Sean Anderson [this message]
2020-09-15 14:44 ` [PATCH v2 05/46] mtd: nand: sunxi: Fix not calling dev_err with a device Sean Anderson
2020-09-15 14:44 ` [PATCH v2 06/46] mtd: spi: Include dm.h in spi-nor-core.c Sean Anderson
2020-09-15 14:44 ` [PATCH v2 07/46] mtd: spi: Fix logging in spi-nor-tiny Sean Anderson
2020-09-15 14:44 ` [PATCH v2 08/46] mtd: spi-nand: Fix not calling dev_err with a device Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 09/46] mmc: Add mmc_dev() Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 10/46] mmc: bcm2835-host: Fix not calling dev_dbg with a device Sean Anderson
2020-09-15 14:44 ` [PATCH v2 11/46] mmc: mtk-sd: Fix not calling dev_err " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 12/46] mailbox: k3: " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 13/46] nand: atmel: Fix not calling dev_xxx " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 14/46] nand: brcmnand: Fix not calling dev_err() " Sean Anderson
2020-09-15 14:44 ` [PATCH v2 15/46] nand: vybrid: Re-introduce vf610_nfc.dev Sean Anderson
2020-09-15 14:44 ` [PATCH v2 16/46] net: bcm6368: Fix not calling dev_info with a device Sean Anderson
2020-09-15 14:44 ` [PATCH v2 17/46] net: mdio: Fix not calling dev_dbg " Sean Anderson
2020-09-15 14:44 ` [PATCH v2 18/46] net: mvneta: Fix not always calling dev_err " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 19/46] net: mvneta: Convert netdev_xxx to dev_xxx Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 20/46] net: mvpp2: Fix not calling dev_xxx with a device Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 21/46] net: mvpp2: Convert netdev_xxx to dev_xxx Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 22/46] linux/compat.h: Remove netdev_xxx functions Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:44 ` [PATCH v2 23/46] net: sunxi: Fix not calling dev_xxx with a device Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:45 ` [PATCH v2 24/46] net: sun8i_emac: " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:45 ` [PATCH v2 25/46] net: ti: cpsw: Fix not calling dev_dbg " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 26/46] phy: marvell: Fix not calling dev_err " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 27/46] phy: rockchip: " Sean Anderson
2020-09-28 2:43 ` Kever Yang
2020-09-15 14:45 ` [PATCH v2 28/46] phy: sun4i-usb: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 29/46] phy: ti: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 30/46] phy: usbphyc: " Sean Anderson
2020-09-16 7:47 ` Patrice CHOTARD
2020-09-16 12:45 ` Patrick DELAUNAY
2020-09-15 14:45 ` [PATCH v2 31/46] remoteproc: Remove unused function rproc_elf_sanity_check Sean Anderson
2020-09-15 14:45 ` [PATCH v2 32/46] remoteproc: k3-r5: Fix not calling dev_xxx with a device Sean Anderson
2020-09-15 14:45 ` [PATCH v2 33/46] remoteproc: k3: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 34/46] soc: qualcomm: Fix not calling dev_err " Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:45 ` [PATCH v2 35/46] spi: sunxi: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 36/46] spi: zynqmp_gqspi: " Sean Anderson
2020-09-16 7:45 ` Michal Simek
2020-09-15 14:45 ` [PATCH v2 37/46] sysreset: ti: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 38/46] usb: cdns3: Fix not calling dev_xxx " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 39/46] usb: dwc2: " Sean Anderson
2020-09-16 7:51 ` Patrice CHOTARD
2020-09-16 12:52 ` Sean Anderson
2020-09-16 13:30 ` Patrick DELAUNAY
2020-09-16 13:43 ` Sean Anderson
2020-09-17 7:33 ` Patrick DELAUNAY
2020-09-15 14:45 ` [PATCH v2 40/46] usb: dwc3: " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 41/46] usb: dwc3: ti: Fix not calling dev_err " Sean Anderson
2020-09-15 14:45 ` [PATCH v2 42/46] usb: dwc3: Don't include asm-generic/io.h Sean Anderson
2020-09-15 14:45 ` [PATCH v2 43/46] usb: musb-new: sunxi: Fix not calling dev_err with a device Sean Anderson
2020-09-15 14:45 ` [PATCH v2 44/46] video: stm32: Fix not calling dev_xxx " Sean Anderson
2020-09-16 13:19 ` Patrick DELAUNAY
2020-09-15 14:45 ` [PATCH v2 45/46] dm: Use symbolic constants for log levels in dev_xxx Sean Anderson
2020-09-17 1:10 ` Simon Glass
2020-09-15 14:45 ` [PATCH v2 46/46] dm: Print device name in dev_xxx like Linux Sean Anderson
2020-09-16 13:43 ` [PATCH v2 00/46] " Patrick DELAUNAY
2020-09-30 13:01 ` Tom Rini
2020-09-30 13:08 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200915144522.509493-5-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox