Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372287
b: refs/heads/master
c: ce63d6d
h: refs/heads/master
i:
  372285: 6cafcbc
  372283: 7b03230
  372279: 68c64b0
  372271: 97da3fd
  372255: 6e99acc
  372223: 06d7e41
v: v3
  • Loading branch information
Stephen Warren authored and Tony Prisk committed Apr 4, 2013
1 parent 9807305 commit 7e07a31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 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: dc1010860b03a0db7683bafb69a4bc2310f4d9ec
refs/heads/master: ce63d6d4bb9f601de32d4b99f925a65182521873
19 changes: 11 additions & 8 deletions trunk/drivers/pinctrl/pinctrl-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,11 +699,6 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc,
return 0;
}

static inline u32 prop_u32(struct property *p, int i)
{
return be32_to_cpup(((__be32 *)p->value) + i);
}

static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
struct device_node *np,
struct pinctrl_map **map, unsigned *num_maps)
Expand Down Expand Up @@ -761,7 +756,9 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
return -ENOMEM;

for (i = 0; i < num_pins; i++) {
pin = prop_u32(pins, i);
err = of_property_read_u32_index(np, "brcm,pins", i, &pin);
if (err)
goto out;
if (pin >= ARRAY_SIZE(bcm2835_gpio_pins)) {
dev_err(pc->dev, "%s: invalid brcm,pins value %d\n",
of_node_full_name(np), pin);
Expand All @@ -770,14 +767,20 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
}

if (num_funcs) {
func = prop_u32(funcs, (num_funcs > 1) ? i : 0);
err = of_property_read_u32_index(np, "brcm,function",
(num_funcs > 1) ? i : 0, &func);
if (err)
goto out;
err = bcm2835_pctl_dt_node_to_map_func(pc, np, pin,
func, &cur_map);
if (err)
goto out;
}
if (num_pulls) {
pull = prop_u32(pulls, (num_pulls > 1) ? i : 0);
err = of_property_read_u32_index(np, "brcm,pull",
(num_funcs > 1) ? i : 0, &pull);
if (err)
goto out;
err = bcm2835_pctl_dt_node_to_map_pull(pc, np, pin,
pull, &cur_map);
if (err)
Expand Down

0 comments on commit 7e07a31

Please sign in to comment.