regulator: Add missing of_node_put()
PATCH 1/1 regulator: Add missing of_node_put()
of_find_node_by_name() returns a node pointer with refcount incremented, use of_node_put() on it when done.
Signed-off-by Axel Lin <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc David Dajun Chen <[email protected]>
Cc Gyungoh Yoo <[email protected]>
Cc MyungJoo Ham <[email protected]>
Cc Graeme Gregory <[email protected]>
Cc Laxman Dewangan <[email protected]>
Cc Shawn Guo <[email protected]>
---
Hi,
I don't have these hardware, only compile test.
Axel
drivers/regulator/88pm8607.c | 1 + drivers/regulator/da9052-regulator.c | 1 + drivers/regulator/max8907-regulator.c | 1 + drivers/regulator/max8925-regulator.c | 1 + drivers/regulator/max8997.c | 2 ++ drivers/regulator/mc13xxx-regulator-core.c | 1 + drivers/regulator/palmas-regulator.c | 1 + drivers/regulator/tps65910-regulator.c | 2 ++ 8 files changed, 10 insertions(+)
drivers/regulator/88pm8607.c +1 -0
@@ -363,6 +363,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, break; } } +of_node_put (nproot);return 0 ; }#else
drivers/regulator/da9052-regulator.c +1 -0
@@ -385,6 +385,7 @@ static int da9052_regulator_probe(struct platform_device *pdev) break; } } +of_node_put (nproot);#endif }
drivers/regulator/max8907-regulator.c +1 -0
@@ -239,6 +239,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) ret =of_regulator_match (&pdev->dev, regulators, max8907_matches,ARRAY_SIZE (max8907_matches)); +of_node_put (regulators);if (ret <0 ) {dev_err (&pdev->dev,"Error parsing regulator init data: %d\n" , ret);
drivers/regulator/max8925-regulator.c +1 -0
@@ -263,6 +263,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, rcount =of_regulator_match (&pdev->dev, np, &max8925_regulator_matches[ridx],1 ); +of_node_put (np);if (rcount <0 )return -ENODEV ; config->init_data = max8925_regulator_matches[ridx].init_data;
drivers/regulator/max8997.c +2 -0
@@ -937,6 +937,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata =devm_kzalloc (&pdev->dev,sizeof (*rdata) * pdata->num_regulators,GFP_KERNEL );if (!rdata) { +of_node_put (regulators_np);dev_err (&pdev->dev,"could not allocate memory for regulator data\n" );return -ENOMEM ; }
@@ -959,6 +960,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, rdata->reg_node = reg_np; rdata++; } +of_node_put (regulators_np);if (of_get_property (pmic_np,"max8997,pmic-buck1-uses-gpio-dvs" ,NULL )) pdata->buck1_gpiodvs = true;
drivers/regulator/mc13xxx-regulator-core.c +1 -0
@@ -175,6 +175,7 @@ int mc13xxx_get_num_regulators_dt(struct platform_device *pdev)for_each_child_of_node (parent, child) num++; +of_node_put (parent);return num; }EXPORT_SYMBOL_GPL (mc13xxx_get_num_regulators_dt);
drivers/regulator/palmas-regulator.c +1 -0
@@ -535,6 +535,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 ;
drivers/regulator/tps65910-regulator.c +2 -0
@@ -994,11 +994,13 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( matches = tps65911_matches;break ;default : +of_node_put (regulators);dev_err (&pdev->dev,"Invalid tps chip version\n" );return NULL ; } ret =of_regulator_match (&pdev->dev, regulators, matches, count); +of_node_put (regulators);if (ret <0 ) {dev_err (&pdev->dev,"Error parsing regulator init data: %d\n" , ret);
Signature · 1 line
1.7.9.5