Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: stw481x: Remove unused fields from struct stw481x

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>

authored by

Axel Lin and committed by
Mark Brown
14aef291 c517d838

+4 -8
+4 -4
drivers/regulator/stw481x-vmmc.c
··· 56 56 { 57 57 struct stw481x *stw481x = dev_get_platdata(&pdev->dev); 58 58 struct regulator_config config = { }; 59 + struct regulator_dev *rdev; 59 60 int ret; 60 61 61 62 /* First disable the external VMMC if it's active */ ··· 76 75 pdev->dev.of_node, 77 76 &vmmc_regulator); 78 77 79 - stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev, 80 - &vmmc_regulator, &config); 81 - if (IS_ERR(stw481x->vmmc_regulator)) { 78 + rdev = devm_regulator_register(&pdev->dev, &vmmc_regulator, &config); 79 + if (IS_ERR(rdev)) { 82 80 dev_err(&pdev->dev, 83 81 "error initializing STw481x VMMC regulator\n"); 84 - return PTR_ERR(stw481x->vmmc_regulator); 82 + return PTR_ERR(rdev); 85 83 } 86 84 87 85 dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n");
-4
include/linux/mfd/stw481x.h
··· 41 41 42 42 /** 43 43 * struct stw481x - state holder for the Stw481x drivers 44 - * @mutex: mutex to serialize I2C accesses 45 44 * @i2c_client: corresponding I2C client 46 - * @regulator: regulator device for regulator children 47 45 * @map: regmap handle to access device registers 48 46 */ 49 47 struct stw481x { 50 - struct mutex lock; 51 48 struct i2c_client *client; 52 - struct regulator_dev *vmmc_regulator; 53 49 struct regmap *map; 54 50 }; 55 51