soc: ti: Use of_property_present() for testing DT property presence
PATCH 1/1 soc: ti: Use of_property_present() for testing DT property presence
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.
--- drivers/soc/ti/knav_qmss_queue.c | 2 +- drivers/soc/ti/omap_prm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/soc/ti/knav_qmss_queue.c +1 -1
@@ -1267,7 +1267,7 @@ static int knav_setup_queue_range(struct knav_device *kdev,if (of_get_property (node,"qalloc-by-id" ,NULL )) range->flags |=RANGE_RESERVED ; -if (of_get_property (node,"accumulator" ,NULL )) { +if (of_property_present (node,"accumulator" )) { ret =knav_init_acc_range (kdev, node, range);if (ret <0 ) {devm_kfree (dev, range);
drivers/soc/ti/omap_prm.c +1 -1
@@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)const char *name;int error; -if (!of_find_property (dev->of_node,"#power-domain-cells" ,NULL )) +if (!of_property_present (dev->of_node,"#power-domain-cells" ))return 0 ;of_node_put (dev->of_node);
Signature · 7 lines
2.39.2 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Rob Herring,
Quoted 8 lines · Rob Herring
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added
of_property_present()helper when we just want to test for presence of a property and nothing more.[...]
I have applied the following to branch ti-drivers-soc-next on [1]. Thank you!
[1/1] soc: ti: Use of_property_present() for testing DT property presence
commit: 1b1b863a8898ad8348b7dfe812cab26cea9099bf
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
[1] git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
Signature · 1 line
Nishanth Menon <[email protected]>