diff options
| -rw-r--r-- | drivers/gpio/gpiolib-of.c | 5 | ||||
| -rw-r--r-- | drivers/pinctrl/mvebu/pinctrl-mvebu.c | 2 | ||||
| -rw-r--r-- | drivers/pinctrl/pinconf.c | 2 | ||||
| -rw-r--r-- | drivers/pinctrl/pinconf.h | 2 | ||||
| -rw-r--r-- | drivers/pinctrl/pinctrl-abx500.c | 2 | ||||
| -rw-r--r-- | drivers/pinctrl/pinmux.c | 5 |
6 files changed, 11 insertions, 7 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a71a54a3e3f7..5150df6cba08 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
| @@ -193,7 +193,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) | |||
| 193 | if (!np) | 193 | if (!np) |
| 194 | return; | 194 | return; |
| 195 | 195 | ||
| 196 | do { | 196 | for (;; index++) { |
| 197 | ret = of_parse_phandle_with_args(np, "gpio-ranges", | 197 | ret = of_parse_phandle_with_args(np, "gpio-ranges", |
| 198 | "#gpio-range-cells", index, &pinspec); | 198 | "#gpio-range-cells", index, &pinspec); |
| 199 | if (ret) | 199 | if (ret) |
| @@ -222,8 +222,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip) | |||
| 222 | 222 | ||
| 223 | if (ret) | 223 | if (ret) |
| 224 | break; | 224 | break; |
| 225 | 225 | } | |
| 226 | } while (index++); | ||
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | #else | 228 | #else |
diff --git a/drivers/pinctrl/mvebu/pinctrl-mvebu.c b/drivers/pinctrl/mvebu/pinctrl-mvebu.c index c689c04a4f52..2d2f0a43d36b 100644 --- a/drivers/pinctrl/mvebu/pinctrl-mvebu.c +++ b/drivers/pinctrl/mvebu/pinctrl-mvebu.c | |||
| @@ -620,7 +620,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) | |||
| 620 | 620 | ||
| 621 | /* special soc specific control */ | 621 | /* special soc specific control */ |
| 622 | if (ctrl->mpp_get || ctrl->mpp_set) { | 622 | if (ctrl->mpp_get || ctrl->mpp_set) { |
| 623 | if (!ctrl->name || !ctrl->mpp_set || !ctrl->mpp_set) { | 623 | if (!ctrl->name || !ctrl->mpp_get || !ctrl->mpp_set) { |
| 624 | dev_err(&pdev->dev, "wrong soc control info\n"); | 624 | dev_err(&pdev->dev, "wrong soc control info\n"); |
| 625 | return -EINVAL; | 625 | return -EINVAL; |
| 626 | } | 626 | } |
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index ac8d382a79bb..d611ecfcbf70 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c | |||
| @@ -622,7 +622,7 @@ static const struct file_operations pinconf_dbg_pinname_fops = { | |||
| 622 | static int pinconf_dbg_state_print(struct seq_file *s, void *d) | 622 | static int pinconf_dbg_state_print(struct seq_file *s, void *d) |
| 623 | { | 623 | { |
| 624 | if (strlen(dbg_state_name)) | 624 | if (strlen(dbg_state_name)) |
| 625 | seq_printf(s, "%s\n", dbg_pinname); | 625 | seq_printf(s, "%s\n", dbg_state_name); |
| 626 | else | 626 | else |
| 627 | seq_printf(s, "No pin state set\n"); | 627 | seq_printf(s, "No pin state set\n"); |
| 628 | return 0; | 628 | return 0; |
diff --git a/drivers/pinctrl/pinconf.h b/drivers/pinctrl/pinconf.h index e3ed8cb072a5..bfda73d64eed 100644 --- a/drivers/pinctrl/pinconf.h +++ b/drivers/pinctrl/pinconf.h | |||
| @@ -90,7 +90,7 @@ static inline void pinconf_init_device_debugfs(struct dentry *devroot, | |||
| 90 | * pin config. | 90 | * pin config. |
| 91 | */ | 91 | */ |
| 92 | 92 | ||
| 93 | #ifdef CONFIG_GENERIC_PINCONF | 93 | #if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS) |
| 94 | 94 | ||
| 95 | void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, | 95 | void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, |
| 96 | struct seq_file *s, unsigned pin); | 96 | struct seq_file *s, unsigned pin); |
diff --git a/drivers/pinctrl/pinctrl-abx500.c b/drivers/pinctrl/pinctrl-abx500.c index caecdd373061..c542a97c82f3 100644 --- a/drivers/pinctrl/pinctrl-abx500.c +++ b/drivers/pinctrl/pinctrl-abx500.c | |||
| @@ -422,7 +422,7 @@ static u8 abx500_get_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, | |||
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | /* check if pin use AlternateFunction register */ | 424 | /* check if pin use AlternateFunction register */ |
| 425 | if ((af.alt_bit1 == UNUSED) && (af.alt_bit1 == UNUSED)) | 425 | if ((af.alt_bit1 == UNUSED) && (af.alt_bit2 == UNUSED)) |
| 426 | return mode; | 426 | return mode; |
| 427 | /* | 427 | /* |
| 428 | * if pin GPIOSEL bit is set and pin supports alternate function, | 428 | * if pin GPIOSEL bit is set and pin supports alternate function, |
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 1a00658b3ea0..bd83c8b01cd1 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
| @@ -194,6 +194,11 @@ static const char *pin_free(struct pinctrl_dev *pctldev, int pin, | |||
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | if (!gpio_range) { | 196 | if (!gpio_range) { |
| 197 | /* | ||
| 198 | * A pin should not be freed more times than allocated. | ||
| 199 | */ | ||
| 200 | if (WARN_ON(!desc->mux_usecount)) | ||
| 201 | return NULL; | ||
| 197 | desc->mux_usecount--; | 202 | desc->mux_usecount--; |
| 198 | if (desc->mux_usecount) | 203 | if (desc->mux_usecount) |
| 199 | return NULL; | 204 | return NULL; |
