Skip to content

Commit

Permalink
gpio: of: Check propname before applying "cs-gpios" quirks
Browse files Browse the repository at this point in the history
SPI GPIO device has more than just "cs-gpio" property in its node and
would request those GPIOs as a part of its initialization. To avoid
applying CS-specific quirk to all of them add a check to make sure
that propname is "cs-gpios".

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>
  • Loading branch information
Andrey Smirnov authored and Linus Walleij committed Mar 28, 2019
1 parent 3b55cb8 commit e5545c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpio/gpiolib-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ static void of_gpio_flags_quirks(struct device_node *np,
* to determine if the flags should have inverted semantics.
*/
if (IS_ENABLED(CONFIG_SPI_MASTER) &&
of_property_read_bool(np, "cs-gpios")) {
of_property_read_bool(np, "cs-gpios") &&
!strcmp(propname, "cs-gpios")) {
struct device_node *child;
u32 cs;
int ret;
Expand Down

0 comments on commit e5545c9

Please sign in to comment.