Skip to contentSkip to conversation

regulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode()

PATCH Applied Roel Kluin 3 participants 3 messages Dec 15, 2009 – Dec 16, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 regulator: wm831x_reg_read() failure unnoticed in wm831x_aldo_get_mode()

ret should be signed to notice a failure in wm831x_reg_read().

---
Found using coccinelle: http://coccinelle.lip6.fr/

drivers/regulator/wm831x-ldo.c +1 -1
index 902db56..61e02ac 100644
@@ -470,7 +470,7 @@ static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev)
 	struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
 	struct wm831x *wm831x = ldo->wm831x;
 	int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
-	unsigned int ret;
+	int ret;
 
 	ret = wm831x_reg_read(wm831x, on_reg);
 	if (ret < 0)
#2 lore raw
In reply to Roel Kluin
Quoted 11 lines · Roel Kluin

ret should be signed to notice a failure in wm831x_reg_read().

---
Found using coccinelle: http://coccinelle.lip6.fr/

drivers/regulator/wm831x-ldo.c +0 -0
index 902db56..61e02ac 100644

drivers/regulator/wm831x-ldo.c static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev) · line 476

Quoted 8 lines
drivers/regulator/wm831x-ldo.c +1 -1
@@ -470,7 +470,7 @@ static unsigned int wm831x_aldo_get_mode(struct regulator_dev *rdev)
 	struct wm831x_ldo *ldo = rdev_get_drvdata(rdev);
 	struct wm831x *wm831x = ldo->wm831x;
 	int on_reg = ldo->base + WM831X_LDO_ON_CONTROL;
-	unsigned int ret;
+	int ret;
 
 	ret = wm831x_reg_read(wm831x, on_reg);
 	if (ret < 0)

Applied.

Thanks

Liam