Browse Source

pinctrl/TB10x: Fix signedness bug

In the TB10x pin database, a port index of -1 is used to indicate
unmuxed GPIO pin groups. This bug fixes a 'cast to unsigned' bug of
this value.

Thanks to Dan Carpenter for highlighting this.

CC: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christian Ruppert <christian.ruppert@abilis.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Christian Ruppert 11 years ago
parent
commit
4c5fba3d4a
1 changed files with 1 additions and 2 deletions
  1. 1 2
      drivers/pinctrl/pinctrl-tb10x.c

+ 1 - 2
drivers/pinctrl/pinctrl-tb10x.c

@@ -629,9 +629,8 @@ static int tb10x_gpio_request_enable(struct pinctrl_dev *pctl,
 	 */
 	 */
 	for (i = 0; i < state->pinfuncgrpcnt; i++) {
 	for (i = 0; i < state->pinfuncgrpcnt; i++) {
 		const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i];
 		const struct tb10x_pinfuncgrp *pfg = &state->pingroups[i];
-		unsigned int port = pfg->port;
 		unsigned int mode = pfg->mode;
 		unsigned int mode = pfg->mode;
-		int j;
+		int j, port = pfg->port;
 
 
 		/*
 		/*
 		 * Skip pin groups which are always mapped and don't need
 		 * Skip pin groups which are always mapped and don't need