pinctrl-bcm2835: Fix cut-and-paste error in "pull" parsing
authorPhil Elwell <phil@raspberrypi.org>
Tue, 1 Mar 2016 01:30:08 +0000 (17:30 -0800)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 18 Apr 2016 12:50:48 +0000 (08:50 -0400)
[ Upstream commit 2c7e3306d23864d49f686f22e56e180ff0fffb7f ]

The DT bindings for pinctrl-bcm2835 allow both the function and pull
to contain either one entry or one per pin. However, an error in the
DT parsing can cause failures if the number of pulls differs from the
number of functions.

Cc: stable@vger.kernel.org
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Reviewed-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/pinctrl/bcm/pinctrl-bcm2835.c

index 8d908e3f42c3d1b89c4f9ac45c7566f00af8b317..03ad08ca7e3b54e7743d394bfaa92cf72db4a740 100644 (file)
@@ -786,7 +786,7 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
                }
                if (num_pulls) {
                        err = of_property_read_u32_index(np, "brcm,pull",
-                                       (num_funcs > 1) ? i : 0, &pull);
+                                       (num_pulls > 1) ? i : 0, &pull);
                        if (err)
                                goto out;
                        err = bcm2835_pctl_dt_node_to_map_pull(pc, np, pin,