linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: discourage passing base to gpio_chip
@ 2015-05-13 11:04 Linus Walleij
  2015-05-14  2:41 ` Alexandre Courbot
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2015-05-13 11:04 UTC (permalink / raw)
  To: linux-gpio; +Cc: Alexandre Courbot, Linus Walleij

Passing a fixed base in struct gpio_chip is done for legacy
systems that cannot handle dynamic allocation. Discourage this
behaviour in the kerneldoc.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/gpio/driver.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 96a678842cde..cc7ec129b329 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -42,8 +42,12 @@ struct seq_file;
  * @dbg_show: optional routine to show contents in debugfs; default code
  *	will be used when this is omitted, but custom code can show extra
  *	state (such as pullup/pulldown configuration).
- * @base: identifies the first GPIO number handled by this chip; or, if
- *	negative during registration, requests dynamic ID allocation.
+ * @base: identifies the first GPIO number handled by this chip;
+ *	or, if negative during registration, requests dynamic ID allocation.
+ *	DEPRECATION: providing anything non-negative and nailing the base
+ *	base offset of GPIO chips is deprecated. Please pass -1 as base to
+ *	let gpiolib select the chip base in all possible cases. We want to
+ *	get rid of the static GPIO number space in the long run.
  * @ngpio: the number of GPIOs handled by this controller; the last GPIO
  *	handled is (base + ngpio - 1).
  * @desc: array of ngpio descriptors. Private.
-- 
1.9.3


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

* Re: [PATCH] gpio: discourage passing base to gpio_chip
  2015-05-13 11:04 [PATCH] gpio: discourage passing base to gpio_chip Linus Walleij
@ 2015-05-14  2:41 ` Alexandre Courbot
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Courbot @ 2015-05-14  2:41 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio

On 05/13/2015 08:04 PM, Linus Walleij wrote:
> Passing a fixed base in struct gpio_chip is done for legacy
> systems that cannot handle dynamic allocation. Discourage this
> behaviour in the kerneldoc.

Good idea, we are still seeing too much of these.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>


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

end of thread, other threads:[~2015-05-14  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13 11:04 [PATCH] gpio: discourage passing base to gpio_chip Linus Walleij
2015-05-14  2:41 ` Alexandre Courbot

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).