Skip to contentSkip to conversation

mfd: stw481x: Remove unused fields from struct stw481x

PATCH Superseded Axel Lin 3 participants 5 messages Feb 13, 2015 – Mar 17, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mfd: 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.

---
 drivers/regulator/stw481x-vmmc.c | 8 ++++----
 include/linux/mfd/stw481x.h      | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/regulator/stw481x-vmmc.c +4 -4
index 89025f5..7d2ae3e 100644
@@ -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 */
@@ -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");
include/linux/mfd/stw481x.h +0 -4
index eda1215..833074b 100644
@@ -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;
 };
 
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#2 lore raw
In reply to Axel Lin
Quoted 9 lines · Axel Lin

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.

---
 drivers/regulator/stw481x-vmmc.c | 8 ++++----
 include/linux/mfd/stw481x.h      | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
Quoted 48 lines
drivers/regulator/stw481x-vmmc.c +4 -4
index 89025f5..7d2ae3e 100644
@@ -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 */
@@ -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");
include/linux/mfd/stw481x.h +0 -4
index eda1215..833074b 100644
@@ -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;
 };
 
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#3 lore raw

2015-02-16 19:51 GMT+08:00 Lee Jones <[email protected]>:

Quoted 6 lines · Axel Lin
Quoted 5 lines

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.

Quoted 7 lines
Quoted 5 lines
---
 drivers/regulator/stw481x-vmmc.c | 8 ++++----
 include/linux/mfd/stw481x.h      | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)

Hi Lee,
I thought you will pick up this patch.
But now I got your ack, I'm not sure what should I do now. Should I resend the patch?

Regards,
Axel

#4 lore raw
Quoted 13 lines · Axel Lin

2015-02-16 19:51 GMT+08:00 Lee Jones <[email protected]>:

Quoted 12 lines · Axel Lin
Quoted 10 lines

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.

---
 drivers/regulator/stw481x-vmmc.c | 8 ++++----
 include/linux/mfd/stw481x.h      | 4 ----
 2 files changed, 4 insertions(+), 8 deletions(-)
Quoted 5 lines
Quoted 1 line

Hi Lee,
I thought you will pick up this patch.
But now I got your ack, I'm not sure what should I do now. Should I resend the patch?

I think Mark should pick this up, as the only changes in MFD are in the header.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog