diff options
Diffstat (limited to 'drivers/regulator/tps65910-regulator.c')
-rw-r--r-- | drivers/regulator/tps65910-regulator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index b0e4c0bc85c3..6ba6931ac855 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c | |||
@@ -964,8 +964,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
964 | { | 964 | { |
965 | struct tps65910_board *pmic_plat_data; | 965 | struct tps65910_board *pmic_plat_data; |
966 | struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); | 966 | struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent); |
967 | struct device_node *np = pdev->dev.parent->of_node; | 967 | struct device_node *np, *regulators; |
968 | struct device_node *regulators; | ||
969 | struct of_regulator_match *matches; | 968 | struct of_regulator_match *matches; |
970 | unsigned int prop; | 969 | unsigned int prop; |
971 | int idx = 0, ret, count; | 970 | int idx = 0, ret, count; |
@@ -978,6 +977,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
978 | return NULL; | 977 | return NULL; |
979 | } | 978 | } |
980 | 979 | ||
980 | np = of_node_get(pdev->dev.parent->of_node); | ||
981 | regulators = of_find_node_by_name(np, "regulators"); | 981 | regulators = of_find_node_by_name(np, "regulators"); |
982 | if (!regulators) { | 982 | if (!regulators) { |
983 | dev_err(&pdev->dev, "regulator node not found\n"); | 983 | dev_err(&pdev->dev, "regulator node not found\n"); |
@@ -994,11 +994,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( | |||
994 | matches = tps65911_matches; | 994 | matches = tps65911_matches; |
995 | break; | 995 | break; |
996 | default: | 996 | default: |
997 | of_node_put(regulators); | ||
997 | dev_err(&pdev->dev, "Invalid tps chip version\n"); | 998 | dev_err(&pdev->dev, "Invalid tps chip version\n"); |
998 | return NULL; | 999 | return NULL; |
999 | } | 1000 | } |
1000 | 1001 | ||
1001 | ret = of_regulator_match(&pdev->dev, regulators, matches, count); | 1002 | ret = of_regulator_match(&pdev->dev, regulators, matches, count); |
1003 | of_node_put(regulators); | ||
1002 | if (ret < 0) { | 1004 | if (ret < 0) { |
1003 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", | 1005 | dev_err(&pdev->dev, "Error parsing regulator init data: %d\n", |
1004 | ret); | 1006 | ret); |