diff mbox

[3/3] pinctrl: sx150x: handle missing 'advanced' reg in sx1504 and sx1505

Message ID 1480675876-19540-4-git-send-email-peda@axentia.se
State New
Headers show

Commit Message

Peter Rosin Dec. 2, 2016, 10:51 a.m. UTC
This fixes a problem where sx150x_regmap_reg_width() returns 8 for the
data register (reg 0) for sx1504 where it should return 4, and return
a correct 8 for sx1505 but for the wrong reason (both chips lack the
'advanced' register). This is not a real problem, since nothing depends
on the function returning 4 or 8, and certainly not if it is returning
8 for the wrong reason. But fix this to avoid nasty surprises down the
line.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/pinctrl/pinctrl-sx150x.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij Dec. 2, 2016, 1:02 p.m. UTC | #1
On Fri, Dec 2, 2016 at 11:51 AM, Peter Rosin <peda@axentia.se> wrote:

> This fixes a problem where sx150x_regmap_reg_width() returns 8 for the
> data register (reg 0) for sx1504 where it should return 4, and return
> a correct 8 for sx1505 but for the wrong reason (both chips lack the
> 'advanced' register). This is not a real problem, since nothing depends
> on the function returning 4 or 8, and certainly not if it is returning
> 8 for the wrong reason. But fix this to avoid nasty surprises down the
> line.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c
index 37b8737e61a9..bdb7ea3d9911 100644
--- a/drivers/pinctrl/pinctrl-sx150x.c
+++ b/drivers/pinctrl/pinctrl-sx150x.c
@@ -967,6 +967,7 @@  static int sx150x_regmap_reg_width(struct sx150x_pinctrl *pctl,
 		    reg == data->pri.x123.reg_advanced)
 		   ||
 		   (data->model == SX150X_456 &&
+		    data->pri.x456.reg_advanced &&
 		    reg == data->pri.x456.reg_advanced)) {
 		return 8;
 	} else {