mtd: spi-nor: hide jedec_id sysfs attribute if not present
authorMichael Walle <michael@walle.cc>
Wed, 10 Aug 2022 22:06:48 +0000 (00:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:11 +0000 (13:14 +0100)
commit58e1a0ef5255c7ed824cb656b31e9a0b8c47f5c6
treed07f94eef1b2b96ac04c06a0aa3ca2994834d6ff
parent348d95e39fec7c9dccf6a61bec0f32791e180925
mtd: spi-nor: hide jedec_id sysfs attribute if not present

[ Upstream commit 7d388551b6888f3725e6c957f472526b35161a5b ]

Some non-jedec compliant flashes (like the Everspin flashes) don't have
an ID at all. Hide the attribute in this case.

Fixes: 36ac02286265 ("mtd: spi-nor: add initial sysfs support")
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Link: https://lore.kernel.org/r/20220810220654.1297699-2-michael@walle.cc
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/ABI/testing/sysfs-bus-spi-devices-spi-nor
drivers/mtd/spi-nor/sysfs.c