summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2019-02-26 07:40:59 -0500
committerMark Brown <broonie@kernel.org>2019-02-26 11:46:10 -0500
commit0e819b51fb9b2558d7cb85400a47370a631325dc (patch)
tree63448e0deed200c74b2ea959175be19ca0a654c0
parent2654d368ea3dc7e04a78ff2531ffd886736ae374 (diff)
regulator: 88pm8607: Remove unused fields from struct pm8607_regulator_info
The *i2c and *i2c_8606 are no longer used since this driver was converted to use regmap helpers. The *chip and *regulator are not really required. So remove these unused fields. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/88pm8607.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 597385d25201..753a6a1b30c3 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/err.h> 13#include <linux/err.h>
14#include <linux/i2c.h>
15#include <linux/of.h> 14#include <linux/of.h>
16#include <linux/regulator/of_regulator.h> 15#include <linux/regulator/of_regulator.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
@@ -22,10 +21,6 @@
22 21
23struct pm8607_regulator_info { 22struct pm8607_regulator_info {
24 struct regulator_desc desc; 23 struct regulator_desc desc;
25 struct pm860x_chip *chip;
26 struct regulator_dev *regulator;
27 struct i2c_client *i2c;
28 struct i2c_client *i2c_8606;
29 24
30 unsigned int *vol_suspend; 25 unsigned int *vol_suspend;
31 26
@@ -350,6 +345,7 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
350 struct pm8607_regulator_info *info = NULL; 345 struct pm8607_regulator_info *info = NULL;
351 struct regulator_init_data *pdata = dev_get_platdata(&pdev->dev); 346 struct regulator_init_data *pdata = dev_get_platdata(&pdev->dev);
352 struct regulator_config config = { }; 347 struct regulator_config config = { };
348 struct regulator_dev *rdev;
353 struct resource *res; 349 struct resource *res;
354 int i; 350 int i;
355 351
@@ -372,13 +368,9 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
372 /* i is used to check regulator ID */ 368 /* i is used to check regulator ID */
373 i = -1; 369 i = -1;
374 } 370 }
375 info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
376 info->i2c_8606 = (chip->id == CHIP_PM8607) ? chip->companion :
377 chip->client;
378 info->chip = chip;
379 371
380 /* check DVC ramp slope double */ 372 /* check DVC ramp slope double */
381 if ((i == PM8607_ID_BUCK3) && info->chip->buck3_double) 373 if ((i == PM8607_ID_BUCK3) && chip->buck3_double)
382 info->slope_double = 1; 374 info->slope_double = 1;
383 375
384 config.dev = &pdev->dev; 376 config.dev = &pdev->dev;
@@ -393,12 +385,11 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
393 else 385 else
394 config.regmap = chip->regmap_companion; 386 config.regmap = chip->regmap_companion;
395 387
396 info->regulator = devm_regulator_register(&pdev->dev, &info->desc, 388 rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
397 &config); 389 if (IS_ERR(rdev)) {
398 if (IS_ERR(info->regulator)) {
399 dev_err(&pdev->dev, "failed to register regulator %s\n", 390 dev_err(&pdev->dev, "failed to register regulator %s\n",
400 info->desc.name); 391 info->desc.name);
401 return PTR_ERR(info->regulator); 392 return PTR_ERR(rdev);
402 } 393 }
403 394
404 platform_set_drvdata(pdev, info); 395 platform_set_drvdata(pdev, info);