summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/bcm
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-12-24 10:25:32 +0300
committerLinus Walleij <linus.walleij@linaro.org>2015-12-24 11:58:05 +0300
commitce6c1cd2c324c027de87d6c249298c9f93463ee8 (patch)
tree2667ef237c0b4876aadcd46aea0ad6b134d60691 /drivers/pinctrl/bcm
parenta898c8358aecc9671aa9acbca00567e7387a62fb (diff)
downloadlinux-ce6c1cd2c324c027de87d6c249298c9f93463ee8.tar.xz
pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength()
There is a signedness bug here so the loop will never exit. Fixes: 8bfcbbbcabe0 ('pinctrl: nsp: add gpio-a driver support for Broadcom NSP SoC') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/bcm')
-rw-r--r--drivers/pinctrl/bcm/pinctrl-nsp-gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
index 1f66761c1a25..725c36f917f9 100644
--- a/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
+++ b/drivers/pinctrl/bcm/pinctrl-nsp-gpio.c
@@ -439,9 +439,10 @@ static int nsp_gpio_set_strength(struct nsp_gpio *chip, unsigned gpio,
static int nsp_gpio_get_strength(struct nsp_gpio *chip, unsigned gpio,
u16 *strength)
{
- unsigned int i, offset, shift;
+ unsigned int offset, shift;
u32 val;
unsigned long flags;
+ int i;
offset = NSP_GPIO_DRV_CTRL;
shift = gpio;