Skip to content

Commit

Permalink
Merge tag 'pinctrl-fixes-for-v3.9' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fixes from Linus Walleij:
 "Here are a few pinctrl fixes for the v3.9 rc series:
   - Usecount bounds checking so we do not go below zero on mux
     usecounts.
   - Loop range checking in GPIO ranges in the DT range parser.
   - Proper print in debugfs for pinconf state.
   - Fix compilation bug in generic pinconf code.
   - Minor bugfixes to abx500 and mvebu drivers."

* tag 'pinctrl-fixes-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinmux: forbid mux_usecount to be set at UINT_MAX
  pinctrl: mvebu: fix checking for SoC specific controls
  pinctrl: generic: Fix compilation error
  pinctrl: Print the correct information in debugfs pinconf-state file
  pinctrl: abx500: Fix checking if pin use AlternateFunction register
  gpio: fix wrong checking condition for gpio range
  • Loading branch information
Linus Torvalds committed Mar 24, 2013
2 parents 33b73e9 + 740924a commit 3912a67
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
5 changes: 2 additions & 3 deletions drivers/gpio/gpiolib-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)
if (!np)
return;

do {
for (;; index++) {
ret = of_parse_phandle_with_args(np, "gpio-ranges",
"#gpio-range-cells", index, &pinspec);
if (ret)
Expand Down Expand Up @@ -222,8 +222,7 @@ static void of_gpiochip_add_pin_range(struct gpio_chip *chip)

if (ret)
break;

} while (index++);
}
}

#else
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/mvebu/pinctrl-mvebu.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)

/* special soc specific control */
if (ctrl->mpp_get || ctrl->mpp_set) {
if (!ctrl->name || !ctrl->mpp_set || !ctrl->mpp_set) {
if (!ctrl->name || !ctrl->mpp_get || !ctrl->mpp_set) {
dev_err(&pdev->dev, "wrong soc control info\n");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ static const struct file_operations pinconf_dbg_pinname_fops = {
static int pinconf_dbg_state_print(struct seq_file *s, void *d)
{
if (strlen(dbg_state_name))
seq_printf(s, "%s\n", dbg_pinname);
seq_printf(s, "%s\n", dbg_state_name);
else
seq_printf(s, "No pin state set\n");
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static inline void pinconf_init_device_debugfs(struct dentry *devroot,
* pin config.
*/

#ifdef CONFIG_GENERIC_PINCONF
#if defined(CONFIG_GENERIC_PINCONF) && defined(CONFIG_DEBUG_FS)

void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev,
struct seq_file *s, unsigned pin);
Expand Down
2 changes: 1 addition & 1 deletion drivers/pinctrl/pinctrl-abx500.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static u8 abx500_get_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip,
}

/* check if pin use AlternateFunction register */
if ((af.alt_bit1 == UNUSED) && (af.alt_bit1 == UNUSED))
if ((af.alt_bit1 == UNUSED) && (af.alt_bit2 == UNUSED))
return mode;
/*
* if pin GPIOSEL bit is set and pin supports alternate function,
Expand Down
5 changes: 5 additions & 0 deletions drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ static const char *pin_free(struct pinctrl_dev *pctldev, int pin,
}

if (!gpio_range) {
/*
* A pin should not be freed more times than allocated.
*/
if (WARN_ON(!desc->mux_usecount))
return NULL;
desc->mux_usecount--;
if (desc->mux_usecount)
return NULL;
Expand Down

0 comments on commit 3912a67

Please sign in to comment.