diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 17:47:01 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-03-15 03:35:38 +0300 |
commit | d02fddf24f984b977633c56e10653a8ff19e8c7b (patch) | |
tree | 7220585c1ecef76b47e61d64191e1e80697fbb71 /drivers/clk/clk.c | |
parent | fe15c26ee26efa11741a7b632e9f23b01aca4cc6 (diff) | |
download | linux-d02fddf24f984b977633c56e10653a8ff19e8c7b.tar.xz |
clk: 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.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144701.1541504-1-robh@kernel.org
Acked-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ae07685c7588..f7528d7f8256 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -4880,8 +4880,8 @@ static struct device_node *get_clk_provider_node(struct device *dev) np = dev->of_node; parent_np = dev->parent ? dev->parent->of_node : NULL; - if (!of_find_property(np, "#clock-cells", NULL)) - if (of_find_property(parent_np, "#clock-cells", NULL)) + if (!of_property_present(np, "#clock-cells")) + if (of_property_present(parent_np, "#clock-cells")) np = parent_np; return np; |