1. 07 Dec, 2016 3 commits
    • Lars-Peter Clausen's avatar
      gpio: chardev: Return error for seek operations · f4e81c52
      Lars-Peter Clausen authored
      The GPIO chardev is used for management tasks (allocating line and event
      handles) and does neither support read() nor write() operations. Hence it
      does not make much sense to allow seek operations.
      
      Currently the chardev uses noop_llseek() for its seek implementation. This
      function does not move the pointer and simply returns the current position
      (always 0 for the GPIO chardev). noop_llseek() is primarily meant for
      devices that can not support seek, but where there might be a user that
      depends on the seek() operation succeeding. For newly added devices that
      can not support seek operations it is recommended to use no_llseek(), which
      will return an error. For more information see commit 6038f373
      ("llseek: automatically add .llseek fop").
      
      Unfortunately this was overlooked when the GPIO chardev ABI was introduced.
      But it is highly unlikely that since then userspace applications have
      appeared that rely on being able to perform non-failing seek operations on
      a GPIO chardev file descriptor. So it should be safe to change from
      noop_llseel() to no_seek(). Also use nonseekable_open() in the chardev
      open() callback to clear the FMODE_SEEK, FMODE_PREAD and FMODE_PWRITE flags
      from the file. Neither of these should be set on a file that does not
      support seek operations.
      
      Cc: stable@vger.kernel.org
      Fixes: 3c702e99 ("gpio: add a userspace chardev ABI for GPIOs")
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      f4e81c52
    • Charles Keepax's avatar
      gpio: arizona: Tidy up probe error path · 975acebb
      Charles Keepax authored
      There is some unnecessary complexity in the error path which now things
      are converted to devm is actually very simple. This patch simplifies
      things.
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      975acebb
    • Charles Keepax's avatar
      gpio: arizona: Remove pointless set of platform drvdata · a3ee78ec
      Charles Keepax authored
      We use the gpio chip private data in all the callbacks so remove this
      redundant line of code.
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      a3ee78ec
  2. 24 Nov, 2016 4 commits
  3. 22 Nov, 2016 4 commits
  4. 16 Nov, 2016 1 commit
  5. 15 Nov, 2016 3 commits
  6. 13 Nov, 2016 1 commit
  7. 12 Nov, 2016 1 commit
  8. 09 Nov, 2016 2 commits
  9. 04 Nov, 2016 1 commit
    • Paul Gortmaker's avatar
      gpio: htc-egpio: Make it explicitly non-modular · 43bbf94c
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/gpio/Kconfig:config HTC_EGPIO
      drivers/gpio/Kconfig:   bool "HTC EGPIO support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We explicitly disallow a driver unbind, since that doesn't have a
      sensible use case anyway, and it allows us to drop the ".remove"
      code for non-modular drivers.
      
      Since module_init was not in use by this code, the init ordering
      remains unchanged with this commit.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Kevin O'Connor <kevin@koconnor.net>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      43bbf94c
  10. 31 Oct, 2016 3 commits
  11. 25 Oct, 2016 2 commits
  12. 24 Oct, 2016 15 commits