Skip to contentSkip to conversation

regulator: as3711: Allow missing init_data for diagnostics

PATCH Applied Axel Lin 2 participants 4 messages Feb 6, 2014 – Feb 11, 2014 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 regulator: as3711: Allow missing init_data for diagnostics

The regulator core supports this to allow the configuration to be inspected at runtime even if no software management is enabled.

---
 drivers/regulator/as3711-regulator.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/regulator/as3711-regulator.c +1 -8
index c77a584..67fd548 100644
@@ -221,7 +221,6 @@ static int as3711_regulator_probe(struct platform_device *pdev)
 {
 	struct as3711_regulator_pdata *pdata = dev_get_platdata(&pdev->dev);
 	struct as3711 *as3711 = dev_get_drvdata(pdev->dev.parent);
-	struct regulator_init_data *reg_data;
 	struct regulator_config config = {.dev = &pdev->dev,};
 	struct as3711_regulator *reg = NULL;
 	struct as3711_regulator *regs;
@@ -252,16 +251,10 @@ static int as3711_regulator_probe(struct platform_device *pdev)
 	}
 
 	for (id = 0, ri = as3711_reg_info; id < AS3711_REGULATOR_NUM; ++id, ri++) {
-		reg_data = pdata->init_data[id];
-
-		/* No need to register if there is no regulator data */
-		if (!reg_data)
-			continue;
-
 		reg = &regs[id];
 		reg->reg_info = ri;
 
-		config.init_data = reg_data;
+		config.init_data = pdata->init_data[id];
 		config.driver_data = reg;
 		config.regmap = as3711->regmap;
 		config.of_node = of_node[id];
Signature · 1 line
1.8.1.2
author
#1 lore raw

PATCH 2/2 regulator: rc5t583: Allow missing init_data for diagnostics

The regulator core supports this to allow the configuration to be inspected at runtime even if no software management is enabled.

---
 drivers/regulator/rc5t583-regulator.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/regulator/rc5t583-regulator.c +1 -8
index b58affb..22d6fd1 100644
@@ -119,7 +119,6 @@ static int rc5t583_regulator_probe(struct platform_device *pdev)
 {
 	struct rc5t583 *rc5t583 = dev_get_drvdata(pdev->dev.parent);
 	struct rc5t583_platform_data *pdata = dev_get_platdata(rc5t583->dev);
-	struct regulator_init_data *reg_data;
 	struct regulator_config config = { };
 	struct rc5t583_regulator *reg = NULL;
 	struct rc5t583_regulator *regs;
@@ -142,12 +141,6 @@ static int rc5t583_regulator_probe(struct platform_device *pdev)
 
 
 	for (id = 0; id < RC5T583_REGULATOR_MAX; ++id) {
-		reg_data = pdata->reg_init_data[id];
-
-		/* No need to register if there is no regulator data */
-		if (!reg_data)
-			continue;
-
 		reg = &regs[id];
 		ri = &rc5t583_reg_info[id];
 		reg->reg_info = ri;
@@ -169,7 +162,7 @@ static int rc5t583_regulator_probe(struct platform_device *pdev)
 
 skip_ext_pwr_config:
 		config.dev = &pdev->dev;
-		config.init_data = reg_data;
+		config.init_data = pdata->reg_init_data[id];
 		config.driver_data = reg;
 		config.regmap = rc5t583->regmap;
 
Signature · 1 line
1.8.1.2
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] regulator: rc5t583: Allow missing init_data for diagnostics

Quoted 2 lines · Axel Lin

The regulator core supports this to allow the configuration to be inspected at runtime even if no software management is enabled.

Applied, thanks.

maintainer Applied
#3 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

The regulator core supports this to allow the configuration to be inspected at runtime even if no software management is enabled.

Applied, thanks.