Skip to contentSkip to conversation

power: regulator: max77686 correct variable type

PATCH New Peng Fan 3 participants 3 messages Jul 28, 2015 – Aug 12, 2015

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 power: regulator: max77686 correct variable type

The return type of pmic_read and pmic_write is signed int, so correct variable 'ret' from type unsigned int to int.

Cc Simon Glass <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
---
 drivers/power/regulator/max77686.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/power/regulator/max77686.c +8 -8
index 37ebe94..29d2632 100644
@@ -313,9 +313,9 @@ static int max77686_ldo_modes(int ldo, struct dm_regulator_mode **modesp,
 
 static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
 {
-	unsigned int ret, hex, adr;
+	unsigned int hex, adr;
 	unsigned char val;
-	int ldo;
+	int ldo, ret;
 
 	if (op == PMIC_OP_GET)
 		*uV = 0;
@@ -354,9 +354,9 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
 
 static int max77686_buck_val(struct udevice *dev, int op, int *uV)
 {
-	unsigned int hex, ret, mask, adr;
+	unsigned int hex, mask, adr;
 	unsigned char val;
-	int buck;
+	int buck, ret;
 
 	buck = dev->driver_data;
 	if (buck < 1 || buck > MAX77686_BUCK_NUM) {
@@ -408,9 +408,9 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV)
 
 static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
 {
-	unsigned int ret, adr, mode;
+	unsigned int adr, mode;
 	unsigned char val;
-	int ldo;
+	int ldo, ret;
 
 	if (op == PMIC_OP_GET)
 		*opmode = -EINVAL;
@@ -539,9 +539,9 @@ static int max77686_ldo_enable(struct udevice *dev, int op, bool *enable)
 
 static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
 {
-	unsigned int ret, mask, adr, mode, mode_shift;
+	unsigned int mask, adr, mode, mode_shift;
 	unsigned char val;
-	int buck;
+	int buck, ret;
 
 	buck = dev->driver_data;
 	if (buck < 1 || buck > MAX77686_BUCK_NUM) {
Signature · 1 line
1.8.4
#1 lore raw

PATCH 1/1 power: regulator: max77686 correct variable type

Quoted 10 lines · Peng Fan

The return type of pmic_read and pmic_write is signed int, so correct variable 'ret' from type unsigned int to int.

Cc Simon Glass <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
---
 drivers/power/regulator/max77686.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
#2 lore raw

PATCH 1/1 power: regulator: max77686 correct variable type

In reply to Peng Fan

Hello,

Quoted 53 lines · Peng Fan

The return type of pmic_read and pmic_write is signed int, so correct variable 'ret' from type unsigned int to int.

Cc Simon Glass <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
---
  drivers/power/regulator/max77686.c | 16 ++++++++--------
  1 file changed, 8 insertions(+), 8 deletions(-)
drivers/power/regulator/max77686.c +6 -6
index 37ebe94..29d2632 100644
@@ -313,9 +313,9 @@ static int max77686_ldo_modes(int ldo, struct dm_regulator_mode **modesp,
 
  static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
  {
-	unsigned int ret, hex, adr;
+	unsigned int hex, adr;
  	unsigned char val;
-	int ldo;
+	int ldo, ret;
 
  	if (op == PMIC_OP_GET)
  		*uV = 0;
@@ -354,9 +354,9 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
 
  static int max77686_buck_val(struct udevice *dev, int op, int *uV)
  {
-	unsigned int hex, ret, mask, adr;
+	unsigned int hex, mask, adr;
  	unsigned char val;
-	int buck;
+	int buck, ret;
 
  	buck = dev->driver_data;
  	if (buck < 1 || buck > MAX77686_BUCK_NUM) {
@@ -408,9 +408,9 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV)
 
  static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
  {
-	unsigned int ret, adr, mode;
+	unsigned int adr, mode;
  	unsigned char val;
-	int ldo;
+	int ldo, ret;
 
  	if (op == PMIC_OP_GET)
  		*opmode = -EINVAL;
@@ -539,9 +539,9 @@ static int max77686_ldo_enable(struct udevice *dev, int op, bool *enable)
 

drivers/power/regulator/max77686.c static int max77686_ldo_enable(struct udevice *dev, int op, bool *enable) · line 547

Quoted 10 lines
drivers/power/regulator/max77686.c +2 -2
  static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
  {
-	unsigned int ret, mask, adr, mode, mode_shift;
+	unsigned int mask, adr, mode, mode_shift;
  	unsigned char val;
-	int buck;
+	int buck, ret;
 
  	buck = dev->driver_data;
  	if (buck < 1 || buck > MAX77686_BUCK_NUM) {

Applied to: u-boot-pmic.

Best regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com