Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: "Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH] mtd: core: print error code if registering NVMEM fails
Date: Mon, 20 Mar 2023 12:21:47 +0100	[thread overview]
Message-ID: <06b37e2a-baab-8b14-60b1-dc695746b906@gmail.com> (raw)
In-Reply-To: <20230320120617.6b9e2a4d@xps-13>

On 20.03.2023 12:06, Miquel Raynal wrote:
> zajec5@gmail.com wrote on Fri, 17 Mar 2023 08:47:36 +0100:
> 
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> It's a common practice that helps debugging problems.
> 
> Totally agree. I actually sent a patch to avoid the error message
> upon EPROBE_DEFER which has the side effect of printing the error
> (thanks to the use of dev_err_probe()):
> 
> https://lore.kernel.org/linux-mtd/20230307192506.439532-1-miquel.raynal@bootlin.com/

I see, thanks, we can drop this (my) patch.


>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
>>   drivers/mtd/mtdcore.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
>> index 83a22566a8ce..8303ce62c751 100644
>> --- a/drivers/mtd/mtdcore.c
>> +++ b/drivers/mtd/mtdcore.c
>> @@ -539,7 +539,8 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
>>   		if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
>>   			mtd->nvmem = NULL;
>>   		} else {
>> -			dev_err(&mtd->dev, "Failed to register NVMEM device\n");
>> +			dev_err(&mtd->dev, "Failed to register NVMEM device: %ld\n",
>> +				PTR_ERR(mtd->nvmem));
>>   			return PTR_ERR(mtd->nvmem);
>>   		}
>>   	}


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2023-03-20 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17  7:47 [PATCH] mtd: core: print error code if registering NVMEM fails Rafał Miłecki
2023-03-20 11:06 ` Miquel Raynal
2023-03-20 11:21   ` Rafał Miłecki [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=06b37e2a-baab-8b14-60b1-dc695746b906@gmail.com \
    --to=zajec5@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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