Add a "label" property to the mtd device
Subsystems (2)
v3 cover Add a "label" property to the mtd device
Hello,
Herer are a couple of patches adding a "label" property to the mtd device, which can be used to identify a specific chip on a system with multiple chips. This is common on the OpenPower boards, there can be four chips holding the firmware for the BMC and the firmware for the host, plus chips with golden images for recovery.
Thanks,
C.
Changes since v2:
- only assign device name from label if mtd->name is undefined
Changes since v1:
- moved the use of the "label" property from mtd_set_dev_defaults() to mtd_set_of_node() to let drivers keep control on how mtd->name is set and allocated.
Cédric Le Goater (2):
mtd: name the mtd device with an optional label property
dt-bindings: mtd: add a common label property to all mtd devices
Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++ include/linux/mtd/mtd.h | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/common.txt
Signature · 6 lines
2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
PATCH v3 1/2 mtd: name the mtd device with an optional label property
In reply to a message not in the archiveThis can be used to easily identify a specific chip on a system with multiple chips.
---
Changes since v2:
- only assign device name from label if mtd->name is undefined
Changes since v1:
- moved the use of the "label" property from mtd_set_dev_defaults() to mtd_set_of_node() to let drivers keep control on how mtd->name is set and allocated.
include/linux/mtd/mtd.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/mtd/mtd.h +3 -0
@@ -24,6 +24,7 @@#include <linux/uio.h> #include <linux/notifier.h> #include <linux/device.h> +#include <linux/of.h> #include <mtd/mtd-abi.h>
@@ -385,6 +386,8 @@ static inline void mtd_set_of_node(struct mtd_info *mtd, struct device_node *np) { mtd->dev.of_node = np; +if (!mtd->name) +of_property_read_string (np,"label" , &mtd->name); }static inline struct device_node *mtd_get_of_node (struct mtd_info *mtd)
Signature · 6 lines
2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v3 2/2 dt-bindings: mtd: add a common label property to all mtd devices
In reply to Cédric Le GoaterThis can be used to easily identify a specific chip on a system with multiple chips.
--- Documentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/common.txt
Documentation/devicetree/bindings/mtd/common.txt new file +15 -0
@@ -0,0 +1,15 @@ +* Common properties of all MTD devices + +Optional properties: +- label: user-defined MTD device name. Can be used to assign user + friendly names to MTD devices (instead of the flash model or flash + controller based name) in order to ease flash device identification + and/or describe what they are used for. + +Example: + + flash@0 { + label = "System-firmware"; + + /* flash type specific properties */ + };
Signature · 6 lines
2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Quoted 7 lines · Cédric Le Goater
Hello,
Herer are a couple of patches adding a "label" property to the mtd device, which can be used to identify a specific chip on a system with multiple chips. This is common on the OpenPower boards, there can be four chips holding the firmware for the BMC and the firmware for the host, plus chips with golden images for recovery.
Series is
Quoted 23 lines
Thanks,
C.
Changes since v2:
- only assign device name from label if
mtd->nameis undefinedChanges since v1:
- moved the use of the "label" property from
mtd_set_dev_defaults()tomtd_set_of_node()to let drivers keep control on howmtd->nameis set and allocated.Cédric Le Goater (2):
mtd: name the mtd device with an optional label property
dt-bindings: mtd: add a common label property to all mtd devicesDocumentation/devicetree/bindings/mtd/common.txt | 15 +++++++++++++++ include/linux/mtd/mtd.h | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/common.txt
Signature · 6 lines
Best regards, Marek Vasut ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
Brian Norris
AppliedQuoted 11 lines · Marek Vasut
Quoted 7 lines · Cédric Le Goater
Hello,
Herer are a couple of patches adding a "label" property to the mtd device, which can be used to identify a specific chip on a system with multiple chips. This is common on the OpenPower boards, there can be four chips holding the firmware for the BMC and the firmware for the host, plus chips with golden images for recovery.
Series is
Reviewed-by Marek Vasut <[email protected]>
Applied to l2-mtd.git.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/