* [PATCH 0/3] Fixup patches for gpiod interface
@ 2013-10-20 22:14 Alexandre Courbot
2013-10-20 22:14 ` [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index() Alexandre Courbot
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Alexandre Courbot @ 2013-10-20 22:14 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, gnurou, Alexandre Courbot
These patches fix a few issues of the gpiod series highlighted by the
autobuild system. They take root in the fact that devres.c was compiled
even when gpiolib is not to be built, which should obviously not happen.
But they also reveal missing includes in the same file, and sparse also
pointed out a suspiscious line that happened to be completely wrong.
Patch 1/3 and 2/3 can be applied on their own, but would probably better
be squashed into bae48da2 "add gpiod_get() and gpiod_put() functions".
Patch 3/3 stands on its own, and should preferably be applied before the
rest of the gpiod series. It would not hurt to apply it after if 1/3 and
2/3 are properly squashed.
Apologies for these issues that could have been caught earlier had I been
less negligent.
Alexandre Courbot (3):
gpiolib: devres: fix devm_gpiod_get_index()
gpiolib: devres: add missing headers
gpiolib: make GPIO_DEVRES depend on GPIOLIB
drivers/gpio/Kconfig | 8 ++++----
drivers/gpio/devres.c | 4 +++-
2 files changed, 7 insertions(+), 5 deletions(-)
--
1.8.4.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index()
2013-10-20 22:14 [PATCH 0/3] Fixup patches for gpiod interface Alexandre Courbot
@ 2013-10-20 22:14 ` Alexandre Courbot
2013-10-23 8:09 ` Linus Walleij
2013-10-20 22:14 ` [PATCH 2/3] gpiolib: devres: add missing headers Alexandre Courbot
2013-10-20 22:14 ` [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB Alexandre Courbot
2 siblings, 1 reply; 7+ messages in thread
From: Alexandre Courbot @ 2013-10-20 22:14 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, gnurou, Alexandre Courbot
Fix the return value if devm_gpiod_get_index(). It was returning 0 while
it should return the obtained GPIO descriptor.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/devres.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index 2caa257..fceebdc 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -80,7 +80,7 @@ struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev,
*dr = desc;
devres_add(dev, dr);
- return 0;
+ return desc;
}
EXPORT_SYMBOL(devm_gpiod_get_index);
--
1.8.4.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/3] gpiolib: devres: add missing headers
2013-10-20 22:14 [PATCH 0/3] Fixup patches for gpiod interface Alexandre Courbot
2013-10-20 22:14 ` [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index() Alexandre Courbot
@ 2013-10-20 22:14 ` Alexandre Courbot
2013-10-20 22:14 ` [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB Alexandre Courbot
2 siblings, 0 replies; 7+ messages in thread
From: Alexandre Courbot @ 2013-10-20 22:14 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, gnurou, Alexandre Courbot
Add missing headers for drivers/gpiolib/devres.c.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/devres.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/devres.c b/drivers/gpio/devres.c
index fceebdc..307464f 100644
--- a/drivers/gpio/devres.c
+++ b/drivers/gpio/devres.c
@@ -15,7 +15,9 @@
*/
#include <linux/module.h>
+#include <linux/err.h>
#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/device.h>
#include <linux/gfp.h>
--
1.8.4.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB
2013-10-20 22:14 [PATCH 0/3] Fixup patches for gpiod interface Alexandre Courbot
2013-10-20 22:14 ` [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index() Alexandre Courbot
2013-10-20 22:14 ` [PATCH 2/3] gpiolib: devres: add missing headers Alexandre Courbot
@ 2013-10-20 22:14 ` Alexandre Courbot
2013-10-23 8:13 ` Linus Walleij
2 siblings, 1 reply; 7+ messages in thread
From: Alexandre Courbot @ 2013-10-20 22:14 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, gnurou, Alexandre Courbot
Current Kconfig allows GPIO_DEVRES to be selected and compiled without
GPIOLIB. This does not make sense anymore since GPIOLIB has become the
exclusive way to deal with GPIOs. This patch makes GPIO_DEVRES available
only if GPIOLIB is selected.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpio/Kconfig | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 92e258c..62eb9ef 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -30,10 +30,6 @@ config ARCH_REQUIRE_GPIOLIB
Selecting this from the architecture code will cause the gpiolib
code to always get built in.
-config GPIO_DEVRES
- def_bool y
- depends on HAS_IOMEM
-
menuconfig GPIOLIB
bool "GPIO Support"
@@ -47,6 +43,10 @@ menuconfig GPIOLIB
if GPIOLIB
+config GPIO_DEVRES
+ def_bool y
+ depends on HAS_IOMEM
+
config OF_GPIO
def_bool y
depends on OF
--
1.8.4.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index()
2013-10-20 22:14 ` [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index() Alexandre Courbot
@ 2013-10-23 8:09 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2013-10-23 8:09 UTC (permalink / raw)
To: Alexandre Courbot; +Cc: linux-gpio, linux-kernel, Alexandre Courbot
On Mon, Oct 21, 2013 at 12:14 AM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> Fix the return value if devm_gpiod_get_index(). It was returning 0 while
> it should return the obtained GPIO descriptor.
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB
2013-10-20 22:14 ` [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB Alexandre Courbot
@ 2013-10-23 8:13 ` Linus Walleij
2013-10-23 8:14 ` Linus Walleij
0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2013-10-23 8:13 UTC (permalink / raw)
To: Alexandre Courbot; +Cc: linux-gpio, linux-kernel, Alexandre Courbot
On Mon, Oct 21, 2013 at 12:14 AM, Alexandre Courbot <acourbot@nvidia.com> wrote:
> Current Kconfig allows GPIO_DEVRES to be selected and compiled without
> GPIOLIB. This does not make sense anymore since GPIOLIB has become the
> exclusive way to deal with GPIOs. This patch makes GPIO_DEVRES available
> only if GPIOLIB is selected.
>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Hm, I wonder about this. Are, or where there ever consumers of generic
GPIO using devres without gpiolib?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB
2013-10-23 8:13 ` Linus Walleij
@ 2013-10-23 8:14 ` Linus Walleij
0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2013-10-23 8:14 UTC (permalink / raw)
To: Alexandre Courbot; +Cc: linux-gpio, linux-kernel, Alexandre Courbot
On Wed, Oct 23, 2013 at 10:13 AM, Linus Walleij
<linus.walleij@linaro.org> wrote:
> On Mon, Oct 21, 2013 at 12:14 AM, Alexandre Courbot <acourbot@nvidia.com> wrote:
>
>> Current Kconfig allows GPIO_DEVRES to be selected and compiled without
>> GPIOLIB. This does not make sense anymore since GPIOLIB has become the
>> exclusive way to deal with GPIOs. This patch makes GPIO_DEVRES available
>> only if GPIOLIB is selected.
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>
> Hm, I wonder about this. Are, or where there ever consumers of generic
> GPIO using devres without gpiolib?
However I've applied the patch so we can see what happens, what
other way is there to test it...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-10-23 8:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-20 22:14 [PATCH 0/3] Fixup patches for gpiod interface Alexandre Courbot
2013-10-20 22:14 ` [PATCH 1/3] gpiolib: devres: fix devm_gpiod_get_index() Alexandre Courbot
2013-10-23 8:09 ` Linus Walleij
2013-10-20 22:14 ` [PATCH 2/3] gpiolib: devres: add missing headers Alexandre Courbot
2013-10-20 22:14 ` [PATCH 3/3] gpiolib: make GPIO_DEVRES depend on GPIOLIB Alexandre Courbot
2013-10-23 8:13 ` Linus Walleij
2013-10-23 8:14 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®