Thread (3 messages) 3 messages, 2 authors, 2015-03-06

[PATCH] RFC: let gpiod_get_optional et all return NULL when GPIOLIB is not enabled

From: Linus Walleij <hidden>
Date: 2015-03-06 08:26:27
Also in: linux-gpio

On Thu, Feb 12, 2015 at 10:03 AM, Uwe Kleine-K?nig
[off-list ref] wrote:
I wonder if gpiod_get_optional et all should be changed to return NULL
instead.
This is actually the norm in most subsystems returning cookie
pointers, clk, regulator, pinctrl... a NULL pointer is a functional
noop. But normally then NULL is returned from all stubs, not
just optional.

Alexandre, what do you say?
The obvious downside is that if the device tree specifies a
reset-gpio and the kernel just fails to use it because there is some
code missing, this should better be an error. (The adau1977 code has
this problem already know, but when changing devm_gpiod_get_optional all
callers are affected.)
Device Tree-specific problems is not something we design
subsystems for, we try to just accomodate them. I'm not
sure I fully understand what you mean here.

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help