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>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
                return NULL;
        }
 
-       if (of_find_property(np, "#cooling-cells", NULL)) {
+       if (of_property_present(np, "#cooling-cells")) {
                struct em_perf_domain *em = em_cpu_get(policy->cpu);
 
                cdev = __cpufreq_cooling_register(np, policy, em);
 
         * strongly recommended to update such old DTs to get correct
         * temperature compensation values for each SoC.
         */
-       if (!of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) {
+       if (!of_property_present(pdev->dev.of_node, "nvmem-cells")) {
                dev_warn(dev,
                         "No OCOTP nvmem reference found, SoC-specific calibration not loaded. Please update your DT.\n");
                return 0;
 
 
        np = of_get_cpu_node(data->policy->cpu, NULL);
 
-       if (!np || !of_find_property(np, "#cooling-cells", NULL)) {
+       if (!np || !of_property_present(np, "#cooling-cells")) {
                data->cdev = cpufreq_cooling_register(data->policy);
                if (IS_ERR(data->cdev)) {
                        ret = PTR_ERR(data->cdev);
 
        platform_set_drvdata(pdev, data);
 
-       if (of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) {
+       if (of_property_present(pdev->dev.of_node, "nvmem-cells")) {
                ret = imx_init_from_nvmem_cells(pdev);
                if (ret)
                        return dev_err_probe(&pdev->dev, ret,
 
         * using DT, then it must be aware that the cooling device
         * loading has to happen via cpufreq driver.
         */
-       if (of_find_property(np, "#thermal-sensor-cells", NULL))
+       if (of_property_present(np, "#thermal-sensor-cells"))
                return 0;
 
        data = ti_bandgap_get_sensor_data(bgp, id);