Skip to content

Commit

Permalink
PM / devfreq: imx-bus: Use of_property_present()
Browse files Browse the repository at this point in the history
Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Link: https://lore.kernel.org/lkml/[email protected]/
Acked-by: Peng Fan <[email protected]>
Signed-off-by: Rob Herring (Arm) <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
  • Loading branch information
robherring authored and chanwoochoi committed Sep 4, 2024
1 parent 629277b commit d475521
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/devfreq/imx-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int imx_bus_init_icc(struct device *dev)
struct imx_bus *priv = dev_get_drvdata(dev);
const char *icc_driver_name;

if (!of_get_property(dev->of_node, "#interconnect-cells", NULL))
if (!of_property_present(dev->of_node, "#interconnect-cells"))
return 0;
if (!IS_ENABLED(CONFIG_INTERCONNECT_IMX)) {
dev_warn(dev, "imx interconnect drivers disabled\n");
Expand Down

0 comments on commit d475521

Please sign in to comment.