From: Brian Norris <computersforpeace@gmail.com>
To: Huang Shijie <b32955@freescale.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org, dedekind1@gmail.com
Subject: Re: [PATCH 7/8] mtd: gpmi: change pr_err to dev_err
Date: Mon, 18 Nov 2013 12:23:40 -0800 [thread overview]
Message-ID: <20131118202340.GC9468@ld-irv-0074.broadcom.com> (raw)
In-Reply-To: <1384410351-2169-8-git-send-email-b32955@freescale.com>
On Thu, Nov 14, 2013 at 02:25:50PM +0800, Huang Shijie wrote:
> There are pr_err and dev_err in the gpmi driver now.
> It makes people confused.
>
> This patch changes all the pr_err to dev_err except the one
> in the gpmi_reset_block().
Hmm, many of these pr_err() are wholely uninformative. They are only
useful for someone who is doing low-level debugging fo the driver, not
for users. At most, they should be {dev_dbg,pr_debug} messages, but
really, they should be removed.
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
> drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 67 ++++++++++++++++++-------------
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 43 ++++++++++----------
> 2 files changed, 61 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> index 10a6f07..82ac4a3 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> @@ -1129,7 +1140,7 @@ int gpmi_send_command(struct gpmi_nand_data *this)
> (struct scatterlist *)pio,
> ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
> if (!desc) {
> - pr_err("step 1 error\n");
> + dev_err(this->dev, "step 1 error\n");
All of these "step 1/2/etc." error messages should not be here. They
should just return a proper error code (not -1) and let the caller
display an error as appropriate. (Most of the callers already handle
this fine.)
> return -1;
> }
>
> @@ -1143,7 +1154,7 @@ int gpmi_send_command(struct gpmi_nand_data *this)
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
>
> if (!desc) {
> - pr_err("step 2 error\n");
> + dev_err(this->dev, "step 2 error\n");
Same here.
> return -1;
> }
>
> @@ -1175,7 +1186,7 @@ int gpmi_send_data(struct gpmi_nand_data *this)
> desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio,
> ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
> if (!desc) {
> - pr_err("step 1 error\n");
> + dev_err(this->dev, "step 1 error\n");
Same here.
> return -1;
> }
>
> @@ -1185,7 +1196,7 @@ int gpmi_send_data(struct gpmi_nand_data *this)
> 1, DMA_MEM_TO_DEV,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - pr_err("step 2 error\n");
> + dev_err(this->dev, "step 2 error\n");
Ditto.
> return -1;
> }
> /* [3] submit the DMA */
> @@ -1212,7 +1223,7 @@ int gpmi_read_data(struct gpmi_nand_data *this)
> (struct scatterlist *)pio,
> ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
> if (!desc) {
> - pr_err("step 1 error\n");
> + dev_err(this->dev, "step 1 error\n");
Ditto.
> return -1;
> }
>
> @@ -1222,7 +1233,7 @@ int gpmi_read_data(struct gpmi_nand_data *this)
> 1, DMA_DEV_TO_MEM,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - pr_err("step 2 error\n");
> + dev_err(this->dev, "step 2 error\n");
Ditto.
> return -1;
> }
>
> @@ -1270,7 +1281,7 @@ int gpmi_send_page(struct gpmi_nand_data *this,
> ARRAY_SIZE(pio), DMA_TRANS_NONE,
> DMA_CTRL_ACK);
> if (!desc) {
> - pr_err("step 2 error\n");
> + dev_err(this->dev, "step 2 error\n");
Ditto.
> return -1;
> }
> set_dma_type(this, DMA_FOR_WRITE_ECC_PAGE);
> @@ -1305,7 +1316,7 @@ int gpmi_read_page(struct gpmi_nand_data *this,
> (struct scatterlist *)pio, 2,
> DMA_TRANS_NONE, 0);
> if (!desc) {
> - pr_err("step 1 error\n");
> + dev_err(this->dev, "step 1 error\n");
Ditto.
> return -1;
> }
>
> @@ -1335,7 +1346,7 @@ int gpmi_read_page(struct gpmi_nand_data *this,
> ARRAY_SIZE(pio), DMA_TRANS_NONE,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - pr_err("step 2 error\n");
> + dev_err(this->dev, "step 2 error\n");
Ditto.
> return -1;
> }
>
> @@ -1356,7 +1367,7 @@ int gpmi_read_page(struct gpmi_nand_data *this,
> DMA_TRANS_NONE,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - pr_err("step 3 error\n");
> + dev_err(this->dev, "step 3 error\n");
Ditto.
> return -1;
> }
>
I'm not taking this patch for now.
Brian
next prev parent reply other threads:[~2013-11-18 20:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 6:25 [PATCH 0/8] the clean-up for gpmi Huang Shijie
2013-11-14 6:25 ` [PATCH 1/8] mtd: gpmi: do not use the local array to do the DMA transfer Huang Shijie
2013-11-14 13:46 ` Ezequiel Garcia
2013-11-15 3:53 ` Huang Shijie
2013-11-14 16:23 ` David Woodhouse
2013-11-15 2:14 ` Huang Shijie
2013-11-14 6:25 ` [PATCH 2/8] mtd: gpmi: delete the gpmi_pre_bbt_scan Huang Shijie
2013-11-14 6:25 ` [PATCH 3/8] mtd: gpmi: remove the unused line Huang Shijie
2013-11-14 6:25 ` [PATCH 4/8] mtd: gpmi: rename the functions from gpmi_nfc_* to gpmi_nand_* Huang Shijie
2013-11-14 6:25 ` [PATCH 5/8] mtd: gpmi: use devm_ioremap_resource Huang Shijie
2013-11-14 13:50 ` Ezequiel Garcia
2013-11-15 3:51 ` Huang Shijie
2013-11-14 6:25 ` [PATCH 6/8] mtd: gpmi: use devm_request_irq Huang Shijie
2013-11-14 6:25 ` [PATCH 7/8] mtd: gpmi: change pr_err to dev_err Huang Shijie
2013-11-18 20:23 ` Brian Norris [this message]
2013-11-19 2:30 ` Huang Shijie
2013-11-14 6:25 ` [PATCH 8/8] mtd: gpmi: change pr_debug to dev_dbg Huang Shijie
2013-11-18 20:24 ` Brian Norris
2013-11-18 20:25 ` [PATCH 0/8] the clean-up for gpmi Brian Norris
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=20131118202340.GC9468@ld-irv-0074.broadcom.com \
--to=computersforpeace@gmail.com \
--cc=b32955@freescale.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/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