1. 05 Jan, 2016 37 commits
  2. 04 Jan, 2016 1 commit
    • Arnd Bergmann's avatar
      gpiolib: always initialize *flags from of_get_named_gpio_flags · 427e0dc5
      Arnd Bergmann authored
      The of_get_named_gpio_flags() function does nothing other than returning
      an error when CONFIG_OF_GPIO is disabled, but that causes spurious
      warnings about possible use of uninitialized variables in any code that
      does not check the of_get_named_gpio_flags() return value before trying
      to use the flags:
      
      drivers/input/misc/rotary_encoder.c: In function 'rotary_encoder_probe':
      drivers/input/misc/rotary_encoder.c:223:28: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      drivers/power/bq24735-charger.c: In function 'bq24735_charger_probe':
      drivers/power/bq24735-charger.c:227:12: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      drivers/power/sbs-battery.c: In function 'sbs_probe':
      drivers/power/sbs-battery.c:782:17: warning: 'gpio_flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      This changes the behavior of the inline helper to set the flags to zero
      when OF_GPIO is disabled, to avoid the warnings. In all cases I've
      encountered, we don't actually get to the place that uses the flags
      if CONFIG_OF is disabled because we won't enter the DT parser code.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      427e0dc5
  3. 27 Dec, 2015 1 commit
  4. 26 Dec, 2015 1 commit
    • Vladimir Zapolskiy's avatar
      gpio: update gpiochip .get() callback description · 60befd2e
      Vladimir Zapolskiy authored
      Since gpiochip .get() callback may return a negative error value, it
      strictly limits the range of possible non-error returned values to
      a subset of [30:0] bitmask, however on practice on success all
      gpiochip drivers return either 0 for low signal or 1 for high signal,
      this is assured by "gpio: *: Be sure to clamp return value" series of
      changes. To avoid any confusion, misinterpretation and potential
      errors while developing gpiochip drivers in future convert this
      implicit assumption to a mandatory rule.
      
      For output signals with unknown output signal state gpiochip drivers
      should return a negative error instead of 0.
      Signed-off-by: default avatarVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      60befd2e