Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302334
b: refs/heads/master
c: ad8bb72
h: refs/heads/master
v: v3
  • Loading branch information
Dong Aisheng authored and Linus Walleij committed Apr 18, 2012
1 parent 25fcd53 commit c630b8b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1d31f71e6ed2f714830df8885ec07dfe1f6632e
refs/heads/master: ad8bb720c23a80233e45ed31d67458f5e5b7ab31
4 changes: 4 additions & 0 deletions trunk/drivers/pinctrl/pinconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,12 @@ static void pinconf_dump_pin(struct pinctrl_dev *pctldev,
static int pinconf_pins_show(struct seq_file *s, void *what)
{
struct pinctrl_dev *pctldev = s->private;
const struct pinconf_ops *ops = pctldev->desc->confops;
unsigned i, pin;

if (!ops || !ops->pin_config_get)
return 0;

seq_puts(s, "Pin config settings per pin\n");
seq_puts(s, "Format: pin (name): pinmux setting array\n");

Expand Down
15 changes: 13 additions & 2 deletions trunk/drivers/pinctrl/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,11 @@ int pinmux_map_to_setting(struct pinctrl_map const *map,
const unsigned *pins;
unsigned num_pins;

if (!pmxops) {
dev_err(pctldev->dev, "does not support mux function\n");
return -EINVAL;
}

setting->data.mux.func =
pinmux_func_name_to_selector(pctldev, map->data.mux.function);
if (setting->data.mux.func < 0)
Expand Down Expand Up @@ -481,11 +486,14 @@ static int pinmux_functions_show(struct seq_file *s, void *what)
{
struct pinctrl_dev *pctldev = s->private;
const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
unsigned nfuncs = pmxops->get_functions_count(pctldev);
unsigned nfuncs;
unsigned func_selector = 0;

mutex_lock(&pinctrl_mutex);
if (!pmxops)
return 0;

mutex_lock(&pinctrl_mutex);
nfuncs = pmxops->get_functions_count(pctldev);
while (func_selector < nfuncs) {
const char *func = pmxops->get_function_name(pctldev,
func_selector);
Expand Down Expand Up @@ -520,6 +528,9 @@ static int pinmux_pins_show(struct seq_file *s, void *what)
const struct pinmux_ops *pmxops = pctldev->desc->pmxops;
unsigned i, pin;

if (!pmxops)
return 0;

seq_puts(s, "Pinmux settings per pin\n");
seq_puts(s, "Format: pin (name): mux_owner gpio_owner hog?\n");

Expand Down

0 comments on commit c630b8b

Please sign in to comment.