Skip to content

Commit

Permalink
regulator: stw481x: Remove unused fields from struct stw481x
Browse files Browse the repository at this point in the history
The mutex lock is not used at all, remove it.
The *vmmc_regulator is not necessary, use a local variable in
stw481x_vmmc_regulator_probe() instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
AxelLin authored and broonie committed Mar 21, 2015
1 parent c517d83 commit 14aef29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions drivers/regulator/stw481x-vmmc.c
Expand Up @@ -56,6 +56,7 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev)
{
struct stw481x *stw481x = dev_get_platdata(&pdev->dev);
struct regulator_config config = { };
struct regulator_dev *rdev;
int ret;

/* First disable the external VMMC if it's active */
Expand All @@ -75,12 +76,11 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev)
pdev->dev.of_node,
&vmmc_regulator);

stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev,
&vmmc_regulator, &config);
if (IS_ERR(stw481x->vmmc_regulator)) {
rdev = devm_regulator_register(&pdev->dev, &vmmc_regulator, &config);
if (IS_ERR(rdev)) {
dev_err(&pdev->dev,
"error initializing STw481x VMMC regulator\n");
return PTR_ERR(stw481x->vmmc_regulator);
return PTR_ERR(rdev);
}

dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n");
Expand Down
4 changes: 0 additions & 4 deletions include/linux/mfd/stw481x.h
Expand Up @@ -41,15 +41,11 @@

/**
* struct stw481x - state holder for the Stw481x drivers
* @mutex: mutex to serialize I2C accesses
* @i2c_client: corresponding I2C client
* @regulator: regulator device for regulator children
* @map: regmap handle to access device registers
*/
struct stw481x {
struct mutex lock;
struct i2c_client *client;
struct regulator_dev *vmmc_regulator;
struct regmap *map;
};

Expand Down

0 comments on commit 14aef29

Please sign in to comment.