All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Aapo Vienamo" <aapo.vienamo@linux.intel.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 2/2] mtd: core: Don't fail mtd_device_parse_register() if OTP is unsupported
Date: Wed, 13 Mar 2024 15:03:52 +0100	[thread overview]
Message-ID: <CZSOG0WG0FAJ.23WQ5CB6Q8RIZ@kernel.org> (raw)
In-Reply-To: <lxl3zzgq4kgbgxkya2c6zyagcnrcyp2lzewu553mkmgdlooeca@m2wyltn7qpog>


[-- Attachment #1.1: Type: text/plain, Size: 1082 bytes --]

Hi,

On Wed Mar 13, 2024 at 2:59 PM CET, Aapo Vienamo wrote:
> On Wed, Mar 13, 2024 at 10:24:13AM +0100, Michael Walle wrote:
> > On Mon Mar 11, 2024 at 5:20 PM CET, Aapo Vienamo wrote:
> > > On Mon, Mar 11, 2024 at 03:38:17PM +0100, Michael Walle wrote:
> > > > Also, you'll print an error message for EOPNOTSUPP, although that is
> > > > not really an error. Is that intended? 
> > >
> > > Well, when we hit this, the functionality of the SPI memory itself is
> > > degraded in the sense that the OTP functionality is not available. What
> > > would you suggest?
> > 
> > But it's not really an error, I mean, we are ignoring that one on
> > purpose now :) I'd just guard it with "if (ret != -EOPNOTSUPP)".
>
> To clarify, are you suggesting a modification like this to the code at
> the end of mtd_otp_nvmem_add()?
>
> err:
> 	nvmem_unregister(...);
> 	if (ret != EOPNOTSUPP)
> 		return dev_err_probe(...);
> 	return 0;

Yes, either this variant, then you don't need to fix the caller or
return EOPNOTSUPP but just don't print the message.

-michael

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

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

WARNING: multiple messages have this Message-ID (diff)
From: "Michael Walle" <mwalle@kernel.org>
To: "Aapo Vienamo" <aapo.vienamo@linux.intel.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	"Mika Westerberg" <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 2/2] mtd: core: Don't fail mtd_device_parse_register() if OTP is unsupported
Date: Wed, 13 Mar 2024 15:03:52 +0100	[thread overview]
Message-ID: <CZSOG0WG0FAJ.23WQ5CB6Q8RIZ@kernel.org> (raw)
In-Reply-To: <lxl3zzgq4kgbgxkya2c6zyagcnrcyp2lzewu553mkmgdlooeca@m2wyltn7qpog>

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

Hi,

On Wed Mar 13, 2024 at 2:59 PM CET, Aapo Vienamo wrote:
> On Wed, Mar 13, 2024 at 10:24:13AM +0100, Michael Walle wrote:
> > On Mon Mar 11, 2024 at 5:20 PM CET, Aapo Vienamo wrote:
> > > On Mon, Mar 11, 2024 at 03:38:17PM +0100, Michael Walle wrote:
> > > > Also, you'll print an error message for EOPNOTSUPP, although that is
> > > > not really an error. Is that intended? 
> > >
> > > Well, when we hit this, the functionality of the SPI memory itself is
> > > degraded in the sense that the OTP functionality is not available. What
> > > would you suggest?
> > 
> > But it's not really an error, I mean, we are ignoring that one on
> > purpose now :) I'd just guard it with "if (ret != -EOPNOTSUPP)".
>
> To clarify, are you suggesting a modification like this to the code at
> the end of mtd_otp_nvmem_add()?
>
> err:
> 	nvmem_unregister(...);
> 	if (ret != EOPNOTSUPP)
> 		return dev_err_probe(...);
> 	return 0;

Yes, either this variant, then you don't need to fix the caller or
return EOPNOTSUPP but just don't print the message.

-michael

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2024-03-13 14:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 13:04 [PATCH 0/2] mtd: core: Handle unsupported OTP operations Aapo Vienamo
2024-03-07 13:04 ` Aapo Vienamo
2024-03-07 13:04 ` [PATCH 1/2] mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add() Aapo Vienamo
2024-03-07 13:04   ` Aapo Vienamo
2024-03-11 14:23   ` Michael Walle
2024-03-11 14:23     ` Michael Walle
2024-03-07 13:04 ` [PATCH 2/2] mtd: core: Don't fail mtd_device_parse_register() if OTP is unsupported Aapo Vienamo
2024-03-07 13:04   ` Aapo Vienamo
2024-03-11 14:38   ` Michael Walle
2024-03-11 14:38     ` Michael Walle
2024-03-11 16:20     ` Aapo Vienamo
2024-03-11 16:20       ` Aapo Vienamo
2024-03-13  9:24       ` Michael Walle
2024-03-13  9:24         ` Michael Walle
2024-03-13 13:59         ` Aapo Vienamo
2024-03-13 13:59           ` Aapo Vienamo
2024-03-13 14:03           ` Michael Walle [this message]
2024-03-13 14:03             ` Michael Walle

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=CZSOG0WG0FAJ.23WQ5CB6Q8RIZ@kernel.org \
    --to=mwalle@kernel.org \
    --cc=aapo.vienamo@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=miquel.raynal@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.