mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Stefan Riedmueller <s.riedmueller@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mtd: Notify user when erasure of a block failed during erase op
Date: Wed, 17 Mar 2021 10:47:39 +0100	[thread overview]
Message-ID: <20210317094739.GA23724@pengutronix.de> (raw)
In-Reply-To: <20210316124420.26239-1-s.riedmueller@phytec.de>

On Tue, Mar 16, 2021 at 01:44:20PM +0100, Stefan Riedmueller wrote:
> Give the user information about the faulty block when an erase
> operation fails with error.
> 
> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> ---
>  drivers/mtd/core.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
> index af33ad665c5a..22eb2a056c4e 100644
> --- a/drivers/mtd/core.c
> +++ b/drivers/mtd/core.c
> @@ -222,8 +222,11 @@ static int mtd_op_erase(struct cdev *cdev, loff_t count, loff_t offset)
>  			printf("Skipping bad block at 0x%08llx\n", addr);
>  		} else {
>  			ret = mtd_erase(mtd, &erase);
> -			if (ret)
> +			if (ret) {
> +				printf("%s: failed to erase block at 0x%08llx\n",
> +					__func__, addr);
>  				return ret;
> +			}
>  		}
>  
>  		addr += mtd->erasesize;
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-03-17  9:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 12:44 Stefan Riedmueller
2021-03-17  9:47 ` Sascha Hauer [this message]

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=20210317094739.GA23724@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.riedmueller@phytec.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