[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJaTeTp2w85UHnmH-PPMZsQGQMNa-93kw-tjmDxA_wjJXkYQcQ@mail.gmail.com>
Date: Tue, 25 Oct 2011 19:44:14 -0400
From: Mike Frysinger <vapier@...too.org>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: Russell King <linux@....linux.org.uk>,
Haavard Skinnemoen <hskinnemoen@...il.com>,
Hans-Christian Egtvedt <egtvedt@...fundet.no>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Paul Mundt <lethal@...ux-sh.org>,
Guan Xuetao <gxt@...c.pku.edu.cn>,
Grant Likely <grant.likely@...retlab.ca>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
uclinux-dist-devel@...ckfin.uclinux.org,
linux-m68k@...ts.linux-m68k.org, linux-mips@...ux-mips.org,
linux-sh@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH] gpiolib/arches: Centralise bolierplate asm/gpio.h
On Tue, Oct 25, 2011 at 03:33, Mark Brown wrote:
> Rather than requiring architectures that use gpiolib but don't have any
> need to define anything custom to copy an asm/gpio.h provide a Kconfig
> symbol which architectures must select in order to include gpio.h and
> for other architectures just provide the trivial implementation directly.
i don't think this is generally how asm-generic is handled. instead, how about:
- move the duplicate code to asm-generic/gpio.h
- have the arches which merely need asm-generic/gpio.h add "generic-y
+= gpio.h" to their include/asm/Kbuild
- for arches which need to override these common funcs in some way,
add #ifdef protection to the asm-generic/gpio.h
and it seems like with slightly more work, this path allow you to
merge most of arch/sh/include/asm/gpio.h. and it has the advantage of
not needing new Kconfig symbols.
for example, with asm-generic/atomic.h, it does:
#ifndef atomic_sub_return
static inline int atomic_sub_return(int i, atomic_t *v)
{ ... common implementation ... }
#endif
and then any arch that wants to override it does:
#define atomic_sub_return atomic_sub_return
static inline int atomic_sub_return(int i, atomic_t *v) { weirdness }
#include <asm-generic/atomic.h>
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists