Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14aef291 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c517d838
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -56,6 +56,7 @@ static int stw481x_vmmc_regulator_probe(struct platform_device *pdev)
{
{
	struct stw481x *stw481x = dev_get_platdata(&pdev->dev);
	struct stw481x *stw481x = dev_get_platdata(&pdev->dev);
	struct regulator_config config = { };
	struct regulator_config config = { };
	struct regulator_dev *rdev;
	int ret;
	int ret;


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


	stw481x->vmmc_regulator = devm_regulator_register(&pdev->dev,
	rdev = devm_regulator_register(&pdev->dev, &vmmc_regulator, &config);
						&vmmc_regulator, &config);
	if (IS_ERR(rdev)) {
	if (IS_ERR(stw481x->vmmc_regulator)) {
		dev_err(&pdev->dev,
		dev_err(&pdev->dev,
			"error initializing STw481x VMMC regulator\n");
			"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");
	dev_info(&pdev->dev, "initialized STw481x VMMC regulator\n");
+0 −4
Original line number Original line Diff line number Diff line
@@ -41,15 +41,11 @@


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