Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[cascardo/linux.git] / drivers / devfreq / exynos-bus.c
index 2363d0a..29866f7 100644 (file)
@@ -383,7 +383,7 @@ err_clk:
 static int exynos_bus_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct device_node *np = dev->of_node;
+       struct device_node *np = dev->of_node, *node;
        struct devfreq_dev_profile *profile;
        struct devfreq_simple_ondemand_data *ondemand_data;
        struct devfreq_passive_data *passive_data;
@@ -407,7 +407,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
        /* Parse the device-tree to get the resource information */
        ret = exynos_bus_parse_of(np, bus);
        if (ret < 0)
-               goto err;
+               return ret;
 
        profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL);
        if (!profile) {
@@ -415,10 +415,13 @@ static int exynos_bus_probe(struct platform_device *pdev)
                goto err;
        }
 
-       if (of_parse_phandle(dev->of_node, "devfreq", 0))
+       node = of_parse_phandle(dev->of_node, "devfreq", 0);
+       if (node) {
+               of_node_put(node);
                goto passive;
-       else
+       } else {
                ret = exynos_bus_parent_parse_of(np, bus);
+       }
 
        if (ret < 0)
                goto err;