Merge remote-tracking branch 'regulator/topic/palmas' into regulator-next
[~shefty/rdma-dev.git] / drivers / regulator / palmas-regulator.c
index 22c6ae27d0087450624daa5ce8f5762093518ff3..cde13bb5a8fbc4163eb7769b9b7e09e90eaf1d75 100644 (file)
@@ -527,6 +527,7 @@ static void palmas_dt_to_pdata(struct device *dev,
        u32 prop;
        int idx, ret;
 
+       node = of_node_get(node);
        regulators = of_find_node_by_name(node, "regulators");
        if (!regulators) {
                dev_info(dev, "regulator node not found\n");
@@ -535,6 +536,7 @@ static void palmas_dt_to_pdata(struct device *dev,
 
        ret = of_regulator_match(dev, regulators, palmas_matches,
                        PALMAS_NUM_REGS);
+       of_node_put(regulators);
        if (ret < 0) {
                dev_err(dev, "Error parsing regulator init data: %d\n", ret);
                return;