From: Pratyush Yadav <pratyush@kernel.org>
To: Tudor Ambarus <tudor.ambarus@linaro.org>
Cc: pratyush@kernel.org, michael@walle.cc,
miquel.raynal@bootlin.com, richard@nod.at,
jaimeliao@mxic.com.tw, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] mtd: spi-nor: sysfs: hide the flash name if not set
Date: Mon, 29 Jan 2024 14:24:19 +0100 [thread overview]
Message-ID: <mafs034ugtgqk.fsf@kernel.org> (raw)
In-Reply-To: <20231215082138.16063-4-tudor.ambarus@linaro.org> (Tudor Ambarus's message of "Fri, 15 Dec 2023 10:21:37 +0200")
On Fri, Dec 15 2023, Tudor Ambarus wrote:
> From: JaimeLiao <jaimeliao@mxic.com.tw>
>
> The flash name is not reliable as we saw flash ID collisions.
> Hide the flash name if not set.
>
> Signed-off-by: JaimeLiao <jaimeliao@mxic.com.tw>
> [ta: update commit subject and description]
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor | 3 +++
> drivers/mtd/spi-nor/sysfs.c | 2 ++
> 2 files changed, 5 insertions(+)
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
> index c800621eff95..6d7be97bf7d1 100644
> --- a/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
> +++ b/Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
> @@ -25,6 +25,9 @@ KernelVersion: 5.14
> Contact: linux-mtd@lists.infradead.org
> Description: (RO) Part name of the SPI NOR flash.
>
> + The attribute is not present if the jedec_id founded in
> + ID table but flash name didn't include in it.
Nitpick: strange sentence construction makes it a bit confusing.
Perhaps:
The attribute is not present if the JEDEC ID table for the flash
does not include its name.
> +
>
> What: /sys/bus/spi/devices/.../spi-nor/sfdp
> Date: April 2021
> diff --git a/drivers/mtd/spi-nor/sysfs.c b/drivers/mtd/spi-nor/sysfs.c
> index 2dfdc555a69f..96064e4babf0 100644
> --- a/drivers/mtd/spi-nor/sysfs.c
> +++ b/drivers/mtd/spi-nor/sysfs.c
> @@ -78,6 +78,8 @@ static umode_t spi_nor_sysfs_is_visible(struct kobject *kobj,
>
> if (attr == &dev_attr_manufacturer.attr && !nor->manufacturer)
> return 0;
> + if (attr == &dev_attr_partname.attr && !nor->info->name)
> + return 0;
Do you want to show the name for the "spi-nor-generic" flash? If not
then perhaps drop its name as well?
> if (attr == &dev_attr_jedec_id.attr && !nor->info->id && !nor->id)
> return 0;
--
Regards,
Pratyush Yadav
next prev parent reply other threads:[~2024-01-29 13:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 8:21 [PATCH 0/4] mtd: spi-nor: mark the flash name as obsolete Tudor Ambarus
2023-12-15 8:21 ` [PATCH 1/4] mtd: spi-nor: print flash ID instead of name Tudor Ambarus
2023-12-18 12:07 ` Michael Walle
2024-01-29 13:12 ` Pratyush Yadav
2023-12-15 8:21 ` [PATCH 2/4] mtd: spi-nor: mark the flash name as obsolete Tudor Ambarus
2023-12-18 12:08 ` Michael Walle
2024-01-29 13:13 ` Pratyush Yadav
2023-12-15 8:21 ` [PATCH 3/4] mtd: spi-nor: sysfs: hide the flash name if not set Tudor Ambarus
2023-12-18 12:11 ` Michael Walle
2024-01-29 13:24 ` Pratyush Yadav [this message]
2023-12-15 8:21 ` [PATCH 4/4] mtd: spi-nor: drop superfluous debug prints Tudor Ambarus
2023-12-15 8:24 ` Tudor Ambarus
2024-01-29 13:26 ` Pratyush Yadav
2024-01-29 13:27 ` Tudor Ambarus
2024-01-29 13:34 ` Pratyush Yadav
2023-12-18 12:14 ` Michael Walle
2023-12-19 2:47 ` [PATCH 0/4] mtd: spi-nor: mark the flash name as obsolete 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=mafs034ugtgqk.fsf@kernel.org \
--to=pratyush@kernel.org \
--cc=jaimeliao@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=michael@walle.cc \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--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