From: s.hauer@pengutronix.de (Sascha Hauer) Date: Fri, 23 Jul 2010 12:50:18 +0200 Subject: [PATCH v3 1/2] eukrea_mbimxsd: factorize motherboard support In-Reply-To: <1279816734-26094-1-git-send-email-eric@eukrea.com> References: <1279816734-26094-1-git-send-email-eric@eukrea.com> Message-ID: <20100723105018.GP14113@pengutronix.de> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Eric, On Thu, Jul 22, 2010 at 06:38:53PM +0200, Eric B?nard wrote: > This motherboard is used for both an i.MX25 and an i.MX35 machines > so we can have only one file to support it in plat-mxc. > > This also fixes the following KConfig warning: > "arch/arm/mach-mx25/Kconfig:18:warning: choice value used outside its > choice group" Reading this patch more closely I don't think this patch is a step forward. Of course it's always a good idea to share common code instead of duplicating it, but to me it seems that baseboard support for i.MX35 and i.MX25 do not share much code. The main thing that's common is the description of the display, but the devices are different, the platform data is different and the iomux setup is different aswell. The #include <../mach-mx*/ looks quite ugly. How about splitting the really common part (display description, more?) to third file and leaving the basboard files where they are? The Kconfig warning could be fixed by prefixing the baseboard variable with MX?5_ or by just moving the option to plat-mxc like you already did in this patch. Sascha > > Signed-off-by: Eric B?nard > --- > v3 : added comment avoir Kconfig's warning and changed define name in .h > as per Uwe's comments > v2 : rebased against last imx-for-2.6.36 branch > arch/arm/mach-mx25/Kconfig | 14 - > arch/arm/mach-mx25/Makefile | 1 - > arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c | 261 -------------------- > arch/arm/mach-mx25/mach-cpuimx25.c | 2 +- > arch/arm/mach-mx3/Kconfig | 14 - > arch/arm/mach-mx3/Makefile | 1 - > arch/arm/mach-mx3/mach-cpuimx35.c | 2 +- > arch/arm/plat-mxc/Kconfig | 8 + > arch/arm/plat-mxc/Makefile | 1 + > .../eukrea_mbimxsd-baseboard.c | 184 +++++++++++--- > .../plat-mxc/include/mach/board-eukrea_cpuimx35.h | 40 --- > ...d-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} | 10 +- > 12 files changed, 163 insertions(+), 375 deletions(-) > delete mode 100644 arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c > rename arch/arm/{mach-mx3 => plat-mxc}/eukrea_mbimxsd-baseboard.c (69%) > delete mode 100644 arch/arm/plat-mxc/include/mach/board-eukrea_cpuimx35.h > rename arch/arm/plat-mxc/include/mach/{board-eukrea_cpuimx25.h => board-eukrea_cpuimxsd.h} (84%) > > diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig > index 67e0b54..5f72318 100644 > --- a/arch/arm/mach-mx25/Kconfig > +++ b/arch/arm/mach-mx25/Kconfig > @@ -14,18 +14,4 @@ config MACH_EUKREA_CPUIMX25 > select IMX_HAVE_PLATFORM_MXC_NAND > select MXC_ULPI if USB_ULPI > > -choice > - prompt "Baseboard" > - depends on MACH_EUKREA_CPUIMX25 > - default MACH_EUKREA_MBIMXSD_BASEBOARD > - > -config MACH_EUKREA_MBIMXSD_BASEBOARD > - prompt "Eukrea MBIMXSD development board" > - bool > - help > - This adds board specific devices that can be found on Eukrea's > - MBIMXSD evaluation board. > - > -endchoice > - > endif > diff --git a/arch/arm/mach-mx25/Makefile b/arch/arm/mach-mx25/Makefile > index 87ffb9c..6ba07b6 100644 > --- a/arch/arm/mach-mx25/Makefile > +++ b/arch/arm/mach-mx25/Makefile > @@ -2,4 +2,3 @@ obj-y := mm.o devices.o > obj-$(CONFIG_ARCH_MX25) += clock.o > obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25_3ds.o > obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += mach-cpuimx25.o > -obj-$(CONFIG_MACH_EUKREA_MBIMXSD_BASEBOARD) += eukrea_mbimxsd-baseboard.o > diff --git a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c > deleted file mode 100644 > index f07b1f9..0000000 > --- a/arch/arm/mach-mx25/eukrea_mbimxsd-baseboard.c > +++ /dev/null > @@ -1,261 +0,0 @@ > -/* > - * Copyright (C) 2010 Eric Benard - eric at eukrea.com > - * > - * Based on pcm970-baseboard.c which is : > - * Copyright (C) 2008 Juergen Beisert (kernel at pengutronix.de) > - * > - * This program is free software; you can redistribute it and/or > - * modify it under the terms of the GNU General Public License > - * as published by the Free Software Foundation; either version 2 > - * of the License, or (at your option) any later version. > - * This program is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with this program; if not, write to the Free Software > - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, > - * MA 02110-1301, USA. > - */ > - > -#include > -#include > -#include > -#include > -#include > -#include