diff options
| author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2019-03-26 02:32:09 -0400 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2019-03-28 12:10:20 -0400 |
| commit | 7ce40277bf848391705011ba37eac2e377cbd9e6 (patch) | |
| tree | fa23231ecd7b8917dd94fbd60d89c5f73da95ad2 | |
| parent | e5545c94e43b8f6599ffc01df8d1aedf18ee912a (diff) | |
gpio: of: Check for "spi-cs-high" in child instead of parent node
"spi-cs-high" is going to be specified in child node of an SPI
controller's representing attached SPI device, so change the code to
look for it there, instead of checking parent node.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Chris Healy <cphealy@gmail.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | drivers/gpio/gpiolib-of.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index ee7f08386a72..0220dd6d64ed 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
| @@ -143,16 +143,16 @@ static void of_gpio_flags_quirks(struct device_node *np, | |||
| 143 | * conflict and the "spi-cs-high" flag will | 143 | * conflict and the "spi-cs-high" flag will |
| 144 | * take precedence. | 144 | * take precedence. |
| 145 | */ | 145 | */ |
| 146 | if (of_property_read_bool(np, "spi-cs-high")) { | 146 | if (of_property_read_bool(child, "spi-cs-high")) { |
| 147 | if (*flags & OF_GPIO_ACTIVE_LOW) { | 147 | if (*flags & OF_GPIO_ACTIVE_LOW) { |
| 148 | pr_warn("%s GPIO handle specifies active low - ignored\n", | 148 | pr_warn("%s GPIO handle specifies active low - ignored\n", |
| 149 | of_node_full_name(np)); | 149 | of_node_full_name(child)); |
| 150 | *flags &= ~OF_GPIO_ACTIVE_LOW; | 150 | *flags &= ~OF_GPIO_ACTIVE_LOW; |
| 151 | } | 151 | } |
| 152 | } else { | 152 | } else { |
| 153 | if (!(*flags & OF_GPIO_ACTIVE_LOW)) | 153 | if (!(*flags & OF_GPIO_ACTIVE_LOW)) |
| 154 | pr_info("%s enforce active low on chipselect handle\n", | 154 | pr_info("%s enforce active low on chipselect handle\n", |
| 155 | of_node_full_name(np)); | 155 | of_node_full_name(child)); |
| 156 | *flags |= OF_GPIO_ACTIVE_LOW; | 156 | *flags |= OF_GPIO_ACTIVE_LOW; |
| 157 | } | 157 | } |
| 158 | break; | 158 | break; |
