diff options
author | JaimeLiao <jaimeliao@mxic.com.tw> | 2023-12-15 09:21:37 +0100 |
---|---|---|
committer | Tudor Ambarus <tudor.ambarus@linaro.org> | 2023-12-19 04:08:23 +0100 |
commit | fc2efaf90a4538781aac26cf44d705c1d93fb9f5 (patch) | |
tree | 52b3ff42cf5ffd0d7b5a785a93255067b81ab9da /drivers/mtd | |
parent | mtd: spi-nor: mark the flash name as obsolete (diff) | |
download | linux-fc2efaf90a4538781aac26cf44d705c1d93fb9f5.tar.xz linux-fc2efaf90a4538781aac26cf44d705c1d93fb9f5.zip |
mtd: spi-nor: sysfs: hide the flash name if not set
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>
Reviewed-by: Michael Walle <michael@walle.cc>
[ta: update commit subject and description and the sysfs description]
Link: https://lore.kernel.org/r/20231215082138.16063-4-tudor.ambarus@linaro.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/spi-nor/sysfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; if (attr == &dev_attr_jedec_id.attr && !nor->info->id && !nor->id) return 0; |