Skip to contentSkip to conversation

regulator: max8952 init a mutex but never use it

PATCH Applied Axel Lin 5 participants 5 messages Aug 2, 2011 – Aug 8, 2011 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

hi,
The max8952 regulator driver init a mutex but never use it, do we really need the mutex? Or should we just remove it?

Regards,
Axel

#1 lore raw
Quoted 4 lines · Axel Lin

hi,
The max8952 regulator driver init a mutex but never use it, do we really need the mutex? Or should we just remove it?

It can be removed if it is not being used anywhere.

Liam

#2 lore raw

PATCH 1/1 regulator: max8952: removed unused mutex.

This patch removes a mutex that is never used in the driver.

Reported-by Axel Lin
---
 drivers/regulator/max8952.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/regulator/max8952.c +0 -3
index daff7fd..2fa8a81 100644
@@ -26,7 +26,6 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/max8952.h>
-#include <linux/mutex.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -47,7 +46,6 @@ enum {
 struct max8952_data {
 	struct i2c_client	*client;
 	struct device		*dev;
-	struct mutex		mutex;
 	struct max8952_platform_data *pdata;
 	struct regulator_dev	*rdev;
 
@@ -208,7 +206,6 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
 	max8952->client = client;
 	max8952->dev = &client->dev;
 	max8952->pdata = pdata;
-	mutex_init(&max8952->mutex);
 
 	max8952->rdev = regulator_register(&regulator, max8952->dev,
 			&pdata->reg_data, max8952);
Signature · 1 line
1.7.4.1
#4 lore raw

Re: [PATCH] regulator: max8952: removed unused mutex.

In reply to MyungJoo Ham
Quoted 29 lines · MyungJoo Ham

This patch removes a mutex that is never used in the driver.

Reported-by Axel Lin
---
 drivers/regulator/max8952.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/regulator/max8952.c +0 -2
index daff7fd..2fa8a81 100644
@@ -26,7 +26,6 @@
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/max8952.h>
-#include <linux/mutex.h>
 #include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -47,7 +46,6 @@ enum {
 struct max8952_data {
 	struct i2c_client	*client;
 	struct device		*dev;
-	struct mutex		mutex;
 	struct max8952_platform_data *pdata;
 	struct regulator_dev	*rdev;
 

drivers/regulator/max8952.c static int __devinit max8952_pmic_probe(struct i2c_client *client, · line 211

Quoted 7 lines
drivers/regulator/max8952.c +0 -1
@@ -208,7 +206,6 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client,
 	max8952->client = client;
 	max8952->dev = &client->dev;
 	max8952->pdata = pdata;
-	mutex_init(&max8952->mutex);
 
 	max8952->rdev = regulator_register(&regulator, max8952->dev,
 			&pdata->reg_data, max8952);

Applied.

Thanks

Liam