public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Jaime Liao <jaimeliao.tw@gmail.com>,
	linux-mtd@lists.infradead.org, pratyush@kernel.org,
	leoyu@mxic.com.tw, jaimeliao@mxic.com.tw
Subject: Re: [PATCH v1 2/2] mtd: spi-nor: hide flash name when the flash name does not exist
Date: Mon, 27 Nov 2023 16:28:21 +0100	[thread overview]
Message-ID: <63508eaccc1dcddf1deb1245ef39f00c@walle.cc> (raw)
In-Reply-To: <e34cc75e-3060-459f-bf09-2f2b3d99678d@linaro.org>

Hi,

>>>> > (null) will print when flash ID founded in ID table but
>>>> > the flash name didn't include in it.
>>>> >
>>>> > Make info->name optional in the print for showing flash name
>>>> > and flash size.
>>>> >
>>>> > Signed-off-by: JaimeLiao <jaimeliao@mxic.com.tw>
>>>> > ---
>>>> >  drivers/mtd/spi-nor/core.c | 2 +-
>>>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>>>> >
>>>> > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
>>>> > index 1c443fe568cf..73405bed2a5a 100644
>>>> > --- a/drivers/mtd/spi-nor/core.c
>>>> > +++ b/drivers/mtd/spi-nor/core.c
>>>> > @@ -3518,7 +3518,7 @@ int spi_nor_scan(struct spi_nor *nor, const
>>>> char > *name,
>>>> >      /* No mtd_info fields should be used up to this point. */
>>>> >      spi_nor_set_mtd_info(nor);
>>>> >
>>>> > -    dev_info(dev, "%s (%lld Kbytes)\n", info->name,
>>>> > +    dev_info(dev, "%s (%lld Kbytes)\n", info->name ?: "",
>>>> 
>>>> Maybe print the jedec id if the name is empty.
>>> 
>>> What about always printing the jedec id if names aren't reliable
>>> enough?
>> 
>> I'm fine with that, too. Actually I've considered that myself, but
>> maybe Tudor or Pratyush want to keep the output backwards compatible.
>> 
> 
> We won't remove the names for flashes that already have a name defined,
> won't we?

No.

> We just deprecate the name field and not use it anymore with
> new flash additions. No backward compatibility problem.

I mean in the kernel console output. Someone out there might parse it.

If you switch from
   dev_info(dev, "%s (%lld Kbytes)\n", info->name, ...)
to
   dev_info(dev, ""%*phN (%lld Kbytes)\n", id_len, id, ...)

> BTW, that print should be lowered to dev_dbg, let's no longer pollute
> the kernel log. Drivers should be quiet if all goes well.

Well, ok, that will also answer my question :) So let's go
with the dev_dbg() and id only.

-michael

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

  reply	other threads:[~2023-11-27 15:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 10:07 [PATCH v1 0/2] Hide flash name if it is not set Jaime Liao
2023-11-27 10:07 ` [PATCH v1 1/2] mtd: spi-nor:sysfs: hide " Jaime Liao
2023-11-27 10:07 ` [PATCH v1 2/2] mtd: spi-nor: hide flash name when the flash name does not exist Jaime Liao
2023-11-27 12:21   ` Michael Walle
2023-11-27 14:47     ` Miquel Raynal
2023-11-27 14:56       ` Michael Walle
2023-11-27 15:21         ` Tudor Ambarus
2023-11-27 15:28           ` Michael Walle [this message]
2023-11-27 17:06             ` Tudor Ambarus
2023-11-27 11:49 ` [PATCH v1 0/2] Hide flash name if it is not set Miquel Raynal
2023-11-27 11:58   ` Michael Walle
2023-11-27 12:03     ` Tudor Ambarus

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=63508eaccc1dcddf1deb1245ef39f00c@walle.cc \
    --to=michael@walle.cc \
    --cc=jaimeliao.tw@gmail.com \
    --cc=jaimeliao@mxic.com.tw \
    --cc=leoyu@mxic.com.tw \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=tudor.ambarus@linaro.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