All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Jean Delvare <khali@linux-fr.org>,
	eric miao <eric.y.miao@gmail.com>
Subject: Re: [patch 2.6.24-rc6-mm 1/9] gpiolib: add drivers/gpio directory
Date: Sat, 29 Dec 2007 10:19:39 -0800	[thread overview]
Message-ID: <200712291019.39969.david-b@pacbell.net> (raw)
In-Reply-To: <20071229065837.GB16569@uranus.ravnborg.org>

On Friday 28 December 2007, Sam Ravnborg wrote:
> kconfig symbols that are "select" targets should be named "HAVE_" so in
> this case you could use HAVE_GPIO_LIB.
> This is by convention only but introduced to make it visible that this is
> a config symbol supposed to be selected.

Not widely adopted yet, but of course such things take time.


> Then on top of that the HAVE_ symbols should not have any dependencies
> so we avoid that "select" selects a symbol where the dependencies are
> not fulfilled.

That limitation of "select" still seems more buglike to me than
anything else, FWIW.  Not that it matters in this case.
 

> In your case you could just use
> obj-y += gpio/
> 
> in the Makefile and then there is no need to actually reference the
> kconfig symbol.

No, that just shifts the reference into the drivers/gpio Makefilee.

 
> ccflags-$(CONFIG_DEBUG_GPIO) := -DDEBUG

Another new convention.  :)

Pretty much like the folowing, then?

- Dave


==============	CUT HERE
Kbuild/Kconfig feedback from Sam Ravnborg, adopting new conventions:

  - HAVE_* for Kconfig symbols that platforms will select

  - Descend into drivers/gpio unconditionally, letting the Makefile
    sort out the differences

  - Use "ccflags-$(CONGIF_DEBUG_GPIO) += -DDEBUG" instead of
    those ugly (but traditional) conditionals.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
 arch/arm/Kconfig           |    4 +-
 arch/avr32/Kconfig         |    2 +-
 drivers/Makefile           |    2 +-
 drivers/gpio/Kconfig       |    4 ++--
 drivers/gpio/Makefile      |   10 ++++------
 include/asm-generic/gpio.h |    2 +-
 6 files changed, 10 insertions(+), 12 deletions(-)

--- at91.orig/arch/arm/Kconfig
+++ at91/arch/arm/Kconfig
@@ -346,7 +346,7 @@ config ARCH_PXA
 	select GENERIC_GPIO
 	select GENERIC_TIME
 	select GENERIC_CLOCKEVENTS
-	select GPIO_LIB
+	select HAVE_GPIO_LIB
 	help
 	  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
--- at91.orig/arch/avr32/Kconfig
+++ at91/arch/avr32/Kconfig
@@ -80,7 +80,7 @@ config PLATFORM_AT32AP
 	select SUBARCH_AVR32B
 	select MMU
 	select PERFORMANCE_COUNTERS
-	select GPIO_LIB
+	select HAVE_GPIO_LIB
 
 choice
 	prompt "AVR32 CPU type"
--- at91.orig/drivers/Makefile
+++ at91/drivers/Makefile
@@ -5,7 +5,7 @@
 # Rewritten to use lists instead of if-statements.
 #
 
-obj-$(CONFIG_GPIO_LIB)		+= gpio/
+obj-y				+= gpio/
 obj-$(CONFIG_PCI)		+= pci/
 obj-$(CONFIG_PARISC)		+= parisc/
 obj-$(CONFIG_RAPIDIO)		+= rapidio/
--- at91.orig/drivers/gpio/Kconfig
+++ at91/drivers/gpio/Kconfig
@@ -2,7 +2,7 @@
 # GPIO infrastructure and expanders
 #
 
-config GPIO_LIB
+config HAVE_GPIO_LIB
 	bool
 	help
 	  Platforms select gpiolib if they use this infrastructure
@@ -10,7 +10,7 @@ config GPIO_LIB
 	  into SOC processors.
 
 menu "GPIO Support"
-	depends on GPIO_LIB
+	depends on HAVE_GPIO_LIB
 
 config DEBUG_GPIO
 	bool "Debug GPIO calls"
--- at91.orig/drivers/gpio/Makefile
+++ at91/drivers/gpio/Makefile
@@ -1,12 +1,10 @@
 # gpio support: dedicated expander chips, etc
 
+ccflags-$(CONGIF_DEBUG_GPIO)	+= -DDEBUG
+
+obj-$(CONFIG_HAVE_GPIO_LIB)	+= gpiolib.o
+
 obj-$(CONFIG_GPIO_MCP23S08)	+= mcp23s08.o
 obj-$(CONFIG_GPIO_PCA9539)	+= pca9539.o
 obj-$(CONFIG_GPIO_PCF857X)	+= pcf857x.o
 
-ifeq ($(CONFIG_DEBUG_GPIO),y)
-EXTRA_CFLAGS += -DDEBUG
-endif
-
-obj-$(CONFIG_GPIO_LIB) += gpiolib.o
-
--- at91.orig/include/asm-generic/gpio.h
+++ at91/include/asm-generic/gpio.h
@@ -1,7 +1,7 @@
 #ifndef _ASM_GENERIC_GPIO_H
 #define _ASM_GENERIC_GPIO_H
 
-#ifdef CONFIG_GPIO_LIB
+#ifdef CONFIG_HAVE_GPIO_LIB
 
 /* Platforms may implement their GPIO interface with library code,
  * at a small performance cost for non-inlined operations and some

  reply	other threads:[~2007-12-29 18:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200712281927.32575.david-b@pacbell.net>
2007-12-29  3:53 ` [patch 2.6.24-rc6-mm 1/9] gpiolib: add drivers/gpio directory David Brownell
2007-12-29  6:58   ` Sam Ravnborg
2007-12-29 18:19     ` David Brownell [this message]
2007-12-29 19:03       ` Sam Ravnborg
2008-01-05 20:07   ` David Brownell
2007-12-29  3:54 ` [patch 2.6.24-rc6-mm 2/9] gpiolib: add gpio provider infrastructure David Brownell
2007-12-29  7:10   ` Sam Ravnborg
2007-12-29 18:35     ` David Brownell
2008-01-05 20:08   ` David Brownell
2007-12-29  3:55 ` [patch 2.6.24-rc6-mm 3/9] gpiolib: update Documentation/gpio.txt David Brownell
2008-01-05 20:09   ` David Brownell
2007-12-29  3:56 ` [patch 2.6.24-rc6-mm 4/9] gpiolib: avr32 at32ap platform support David Brownell
2008-01-05 20:10   ` David Brownell
2008-01-05 20:49     ` Haavard Skinnemoen
2008-01-05 22:09       ` David Brownell
2007-12-29  3:57 ` [patch 2.6.24-rc6-mm 5/9] gpiolib: pxa " David Brownell
2008-01-05 20:11   ` David Brownell
2007-12-29  3:58 ` [patch 2.6.24-rc6-mm 6/9] gpiolib: pcf857x i2c gpio expander support David Brownell
2008-01-05 20:13   ` David Brownell
     [not found] ` <200712281927.32575.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-12-29  3:58   ` [patch 2.6.24-rc6-mm 7/9] gpiolib: mcp23s08 spi " David Brownell
2007-12-29  3:58     ` David Brownell
2007-12-29  3:58 ` [patch 2.6.24-rc6-mm 8/9] gpiolib: pca9539 i2c " David Brownell
2008-01-02 13:46   ` Jean Delvare
2008-01-04  1:41     ` David Brownell
2008-01-05 19:40   ` David Brownell
2008-01-06 12:59     ` Jean Delvare
2007-12-29  3:59 ` [patch 2.6.24-rc6-mm 9/9] gpiolib: deprecate obsolete pca9539 driver David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200712291019.39969.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=akpm@linux-foundation.org \
    --cc=eric.y.miao@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.