linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] gpiolib: some fixup patches
@ 2013-02-15  5:46 Alexandre Courbot
  2013-02-15  5:46 ` [PATCH 1/4] gpiolib: check descriptors validity before use Alexandre Courbot
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Alexandre Courbot @ 2013-02-15  5:46 UTC (permalink / raw)
  To: Grant Likely
  Cc: Linus Walleij, Ryan Mallon, linux-kernel, gnurou, Alexandre Courbot

This short series is a fixup to patch 6/9 of my previous series ("gpiolib: use
descriptors internally"), which mainly addresses issues raised by Linus W. in
this patch and a few other minor ones caught while proof-reading gpiolib.

First patch is the most significant. It mostly avoids oopses when passing an
invalid GPIO to some functions. Also gpio_get/set_value*() now return 0 when
given an invalid GPIO number instead of oopsing. I tend to think that's an
improvement, but if it's not please let me know.

Ideally these patches should be melded into the above-mentioned patch since
they were intended to become a new revision, but I leave that decision to
Grant's discretion.

This patchset has been tested on Tegra 2/Ventana with a GPIO backlight driver
and the sysfs interface.

Changes from v1:
- as suggested by Ryan Mallon, add a dedicated control flow for signaling
  invalid GPIOs to avoid meaningless error messages and ugly ternary operators
- use pr_warn instead of pr_debug to signal invalid GPIOs
- do descriptors validity check before acquiring any lock

Alexandre Courbot (4):
  gpiolib: check descriptors validity before use
  gpiolib: use const parameters when possible
  gpiolib: move comment to right function
  gpiolib: rename local offset variables to "hwgpio"

 drivers/gpio/gpiolib.c | 213 +++++++++++++++++++++++++++----------------------
 1 file changed, 117 insertions(+), 96 deletions(-)

-- 
1.8.1.3


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-02-28  6:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15  5:46 [PATCH v2 0/4] gpiolib: some fixup patches Alexandre Courbot
2013-02-15  5:46 ` [PATCH 1/4] gpiolib: check descriptors validity before use Alexandre Courbot
2013-02-26 17:48   ` Grant Likely
2013-02-15  5:46 ` [PATCH 2/4] gpiolib: use const parameters when possible Alexandre Courbot
2013-02-26 17:49   ` Grant Likely
2013-02-15  5:46 ` [PATCH 3/4] gpiolib: move comment to right function Alexandre Courbot
2013-02-15  5:46 ` [PATCH 4/4] gpiolib: rename local offset variables to "hwgpio" Alexandre Courbot
2013-02-26 17:51   ` Grant Likely
2013-02-22  2:19 ` [PATCH v2 0/4] gpiolib: some fixup patches Alexandre Courbot
2013-02-26 17:53   ` Grant Likely
2013-02-27  1:22     ` Alexandre Courbot
2013-02-27  7:52       ` Grant Likely
2013-02-28  4:57         ` Alexandre Courbot
2013-02-28  6:21         ` Linus Walleij
2013-02-28  6:47           ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).