Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757541Ab2HWLfa (ORCPT ); Thu, 23 Aug 2012 07:35:30 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:56256 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755448Ab2HWLf0 (ORCPT ); Thu, 23 Aug 2012 07:35:26 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 4/4] [RFC] ARM: treewide: manually change more mach-*/*.h includes Date: Thu, 23 Aug 2012 11:35:11 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) Cc: "Russell King - ARM Linux" , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org References: <201208221253.07278.arnd@arndb.de> <201208221301.19439.arnd@arndb.de> <20120822214323.GA12255@n2100.arm.linux.org.uk> In-Reply-To: <20120822214323.GA12255@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201208231135.11688.arnd@arndb.de> X-Provags-ID: V02:K0:Dk01C/EDXMccnxjchAP7wD+GzzFPA83Nzd+IkF//oxx yw6ooyKQUBSVIB5K0d13JVsvPed5hNj6MKeG6Ila73p3PyYRCQ H1zDMaAZexdy5nFMz5HxCqyAWt/YbdRLOc0WFRG/86s0+RgU39 j0tnKnidjfp6uc1MuCeWPWxzUenBAinif0FWbmYv/KzsB28lgc ibq9h5y4OfRu5sRklC8Bnsl8Tspl0+yhmCJAPzHnibq85bwAGS ob5MRpi4wX/Sh7WWolfuL2GU2sx7mJjb9/R+vQIsUZgi7bu3BD T/pbv0uU84zZxk1SnGvPai+g+2OKA6V0qtyZe5b+eR7suVQSat lywoIWJk/VomoHqJqvXA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 19111 Lines: 380 On Wednesday 22 August 2012, Russell King - ARM Linux wrote: > > On Wed, Aug 22, 2012 at 01:01:19PM +0000, Arnd Bergmann wrote: > > These are lots of device drivers that include machine > > specific header files from ARM platforms and that are > > not easily scriptable. The changes have been found through > > manual inspection and should cause no visible changes > > because of the build script that maps the old names to the > > new ones. > > And you end up missing a bunch of drivers in the process, such as the > sa1100 RTC driver which is shared between sa11x0 and PXA. I wonder > how many of the Samsung platforms get broken by this as well... I'm well aware of the files that are not converted in this series, but I'm also reasonably sure that I'm not breaking them in the process, as long as we don't revert the first patch before the conversion is done. I have added a list of the remaining ones at the end of this email for reference. Most of them are for the Samsung platforms, and they are already working on cleaning that up. > In any case, what we should be doing here as well is moving the headers > included by drivers for platform data out of the arch/arm/mach/ subtrees > and into include/linux/platform_data. That will substantially reduce the > amount of mach/ headers to deal with. I've just looked at the {mach,plat}/*.h files that get included in ARM specific drivers. Out of the 342 header files that get used in this way, I found 93 that are practically just platform data, and a few that are platform_data mixed with something else. How about I move all the pure platform data definition files now and rebase the other patches on top of that. Here is a list of suggested file names in include/linux/platform_data/: mach-at91/at_hdmac.h -> dma-atmel.h mach-davinci/aemif.h -> mtd-davinci-aemif.h mach-davinci/asp.h -> asoc-davinci-evm.h mach-davinci/i2c.h -> i2c-davinci.h mach-davinci/keyscan.h -> keyscan-davinci.h mach-davinci/mmc.h -> mmc-davinci.h mach-davinci/nand.h -> mtd-davinci.h mach-davinci/spi.h -> spi-davinci.h mach-davinci/usb.h -> usb-davinci.h mach-ep93xx/dma.h -> dma-ep93xx.h mach-ep93xx/ep93xx_keypad.h -> keypad-ep93xx.h mach-ep93xx/ep93xx_spi.h -> spi-ep93xx.h mach-ep93xx/fb.h -> video-ep93xx.h mach-exynos/ohci.h -> usb-exynos.h mach-imx/dma.h -> dma-imx.h mach-imx/esdhc.h -> mmc-esdhc-imx.h mach-imx/i2c.h -> i2c-imx.h mach-imx/imx-uart.h -> serial-imx.h mach-imx/imxfb.h -> video-imxfb.h mach-imx/mmc.h -> mmc-mxcmmc.h mach-imx/mx1_camera.h -> camera-mx1.h mach-imx/mx21-usbhost.h -> usb-mx2.h mach-imx/mx2_cam.h -> camera-mx2.h mach-imx/mx3_camera.h -> camera-mx3.h mach-imx/mx3fb.h -> video-mx3fb.h mach-imx/mxc_ehci.h -> usb-ehci-mxc.h mach-imx/mxc_nand.h -> mtd-mxc_nand.h mach-imx/sdma.h -> dma-imx-sdma.h mach-imx/spi.h -> spi-imx.h mach-imx/ssi.h -> asoc-imx-ssi.h mach-imx/usb.h -> usb-imx_udc.h mach-kirkwood/leds-netxbig.h -> leds-kirkwood-netxbig.h mach-kirkwood/leds-ns2.h -> leds-kirkwood-ns2.h mach-mmp/sram.h -> dma-mmp_tdma.h mach-msm/mmc.h -> mmc-msm_sdcc.h mach-msm/msm_fb.h -> video-msm_fb.h mach-netx/eth.h -> eth-netx.h mach-nomadik/nand.h -> mtd-nomadik-nand.h mach-pxa/arcom-pcmcia.h -> pcmcia-pxa2xx_viper.h mach-pxa/camera.h -> camera-pxa.h mach-pxa/irda.h -> irda-pxaficp.h mach-pxa/mmc.h -> mmc-pxamci.h mach-pxa/ohci.h -> usb-ohci-pxa27x.h mach-pxa/palmasoc.h -> asoc-palm27x.h mach-pxa/pata_pxa.h -> ata-pxa.h mach-pxa/pxa3xx-u2d.h -> usb-ohci-pxa27x.h mach-pxa/pxa930_rotary.h -> keyboard-pxa930_rotary.h mach-pxa/pxa930_trkball.h -> mouse-pxa930_trkball.h mach-pxa/pxafb.h -> video-pxafb.h mach-s3c24xx/leds-gpio.h -> leds-s3c24xx.h mach-sa1100/mcp.h -> mfd-mcp-sa11x0.h mach-tegra/kbc.h -> keyboard-tegra-kbc.h mach-tegra/sdhci.h -> mmc-sdhci-tegra.h mach-tegra/tegra_wm8903_pdata.h -> asoc-tegra_wm8903.h mach-u300/gpio-u300.h -> pinctrl-coh901.h mach-ux500/crypto-ux500.h -> crypto-ux500.h mach-ux500/usb.h -> usb-musb-ux500.h mach-ux500/msp.h -> asoc-ux500-msp.h mach-vt8500/vt8500fb.h -> video-vt8500lcdfb.h mach-w90x900/fb.h -> video-nuc900fb.h mach-w90x900/i2c.h -> i2c-nuc900.h mach-w90x900/nuc900_spi.h -> spi-nuc900.h mach-w90x900/w90p910_keypad.h -> keypad-w90p910.h plat-nomadik/ske.h -> keypad-nomadik-ske.h plat-omap/dsp.h -> dsp-omap.h plat-omap/keypad.h -> keypad-omap.h plat-omap/lcd_mipid.h -> lcd-mipid.h plat-omap/mcbsp.h -> dsp-mcbsp.h plat-omap/mcspi.h -> spi-omap2-mcspi.h plat-omap/nand.h -> mtd-nand-omap2.h plat-omap/onenand.h -> mtd-onenand-omap2.h plat-omap/remoteproc.h -> remoteproc-omap.h plat-omap/voltage.h -> smartreflex-omap.h plat-orion/audio.h -> asoc-kirkwood.h plat-orion/ehci-orion.h -> usb-ehci-orion.h plat-orion/mv_xor.h -> dma-mv_xor.h plat-orion/mvsdio.h -> mmc-mvsdio.h plat-orion/orion_nand.h -> mtd-orion_nand.h plat-pxa/pxa27x_keypad.h -> keypad-pxa27x.h plat-pxa/pxa3xx_nand.h -> mtd-nand-pxa3xx.h plat-samsung/ata.h -> ata-samsung_cf.h plat-samsung/audio-simtec.h -> asoc-s3c24xx_simtec.h plat-samsung/audio.h -> asoc-s3c.h plat-samsung/ehci.h -> usb-ehci-s5p.h plat-samsung/hwmon.h -> hwmon-s3c.h plat-samsung/iic.h -> i2c-s3c2410.h plat-samsung/mci.h -> mmc-s3cmci.h plat-samsung/mipi_csis.h -> mipi-csis.h plat-samsung/nand.h -> mtd-nand-s3c2410.h plat-samsung/s3c64xx-spi.h -> spi-s3c64xx.h plat-samsung/ts.h -> touchscreen-s3c2410.h plat-samsung/udc.h -> usb-s3c2410_udc.h plat-samsung/usb-control.h -> usb-ohci-s3c2410.h plat-spear/keyboard.h -> keyboard-spear.h > Where I want this to get to is not a persistence of the existing crappy > situation where platforms stuff platform data definitions into arch/arm, > but instead put them in the right place. Agreed. > That means providing them with a good reason why the existing solution > won't work, and not allowing mach/ includes in drivers is a very good > way to achieve that. About two third of the platform header files included in device drivers are not related to platform_data according to what I found. Most of them are also wrong (hardcoding interrupt numbers or addresses, headers included by accident but not actually used, driver specific definitions that don't belong in the platform, platform specific abstraction layers, ...), but they tend to be harder to clean up. I hope we can get there eventually, but I think the intermediate step of enforcing a mach-${MACH}/foo.h is a step in the right direction on that way. While my immediate goal of course is to get the multiplatform kernel running and not to clean up the mess with mach headers, I think it's good if the dependency on a specific platform is highlighted in the source code so it can be picked on better in reviews. Arnd ** list of mach/* inclusions that I could not match with ** exactly one ARM platform: $ git grep ^#include.*\ arch/arm/boot/compressed/misc.c:#include arch/arm/boot/compressed/mmcif-sh7372.c:#include arch/arm/boot/compressed/sdhi-sh7372.c:#include arch/arm/common/locomo.c:#include arch/arm/common/sa1111.c:#include arch/arm/include/asm/barrier.h:#include arch/arm/include/asm/clkdev.h:#include arch/arm/include/asm/dma.h:#include arch/arm/include/asm/floppy.h:#include arch/arm/include/asm/gpio.h:#include arch/arm/include/asm/hardware/dec21285.h:#include arch/arm/include/asm/hardware/iop3xx-adma.h:#include arch/arm/include/asm/hardware/iop3xx-gpio.h:#include arch/arm/include/asm/hardware/it8152.h:#include arch/arm/include/asm/hardware/sa1111.h:#include arch/arm/include/asm/io.h:#include arch/arm/include/asm/irq.h:#include arch/arm/include/asm/memory.h:#include arch/arm/include/asm/mtd-xip.h:#include arch/arm/include/asm/timex.h:#include arch/arm/kernel/debug.S:#include arch/arm/kernel/entry-armv.S:#include arch/arm/kernel/entry-common.S:#include arch/arm/kernel/head.S:#include arch/arm/mm/proc-sa110.S:#include arch/arm/mm/proc-sa1100.S:#include arch/arm/plat-iop/adma.c:#include arch/arm/plat-iop/i2c.c:#include arch/arm/plat-iop/pci.c:#include arch/arm/plat-iop/pmu.c:#include arch/arm/plat-iop/restart.c:#include arch/arm/plat-iop/time.c:#include arch/arm/plat-iop/time.c:#include arch/arm/plat-omap/debug-devices.c:#include arch/arm/plat-omap/debug-leds.c:#include arch/arm/plat-omap/devices.c:#include arch/arm/plat-omap/dma.c:#include arch/arm/plat-omap/dmtimer.c:#include arch/arm/plat-omap/fb.c:#include arch/arm/plat-omap/i2c.c:#include arch/arm/plat-omap/include/plat-omap/gpio.h:#include arch/arm/plat-omap/include/plat-omap/irqs.h:#include arch/arm/plat-orion/common.c:#include arch/arm/plat-orion/mpp.c:#include arch/arm/plat-pxa/dma.c:#include arch/arm/plat-pxa/dma.c:#include arch/arm/plat-pxa/ssp.c:#include arch/arm/plat-samsung/clock.c:#include arch/arm/plat-samsung/cpu.c:#include arch/arm/plat-samsung/devs.c:#include arch/arm/plat-samsung/devs.c:#include arch/arm/plat-samsung/devs.c:#include arch/arm/plat-samsung/devs.c:#include arch/arm/plat-samsung/dma-ops.c:#include arch/arm/plat-samsung/dma.c:#include arch/arm/plat-samsung/dma.c:#include arch/arm/plat-samsung/include/plat-samsung/dma-ops.h:#include arch/arm/plat-samsung/include/plat-samsung/irq.h:#include arch/arm/plat-samsung/include/plat-samsung/irq.h:#include arch/arm/plat-samsung/include/plat-samsung/irq.h:#include arch/arm/plat-samsung/include/plat-samsung/regs-onenand.h:#include arch/arm/plat-samsung/include/plat-samsung/regs-srom.h:#include arch/arm/plat-samsung/include/plat-samsung/watchdog-reset.h:#include arch/arm/plat-samsung/init.c:#include arch/arm/plat-samsung/irq-vic-timer.c:#include arch/arm/plat-samsung/pm.c:#include arch/arm/plat-samsung/pm.c:#include arch/arm/plat-samsung/pm.c:#include arch/arm/plat-samsung/pm.c:#include arch/arm/plat-samsung/pm.c:#include arch/arm/plat-samsung/pwm-clock.c:#include arch/arm/plat-samsung/pwm-clock.c:#include arch/arm/plat-samsung/s3c-dma-ops.c:#include arch/arm/plat-samsung/s5p-clock.c:#include arch/arm/plat-samsung/s5p-dev-mfc.c:#include arch/arm/plat-samsung/s5p-dev-uart.c:#include arch/arm/plat-samsung/s5p-dev-uart.c:#include arch/arm/plat-samsung/s5p-irq-eint.c:#include arch/arm/plat-samsung/s5p-irq-eint.c:#include arch/arm/plat-samsung/s5p-irq-gpioint.c:#include arch/arm/plat-samsung/s5p-irq-pm.c:#include arch/arm/plat-samsung/s5p-irq-pm.c:#include arch/arm/plat-samsung/s5p-irq-pm.c:#include arch/arm/plat-samsung/s5p-irq.c:#include arch/arm/plat-samsung/s5p-time.c:#include arch/arm/plat-samsung/setup-mipiphy.c:#include arch/arm/plat-samsung/time.c:#include arch/arm/plat-samsung/time.c:#include arch/arm/plat-samsung/time.c:#include arch/arm/plat-spear/include/plat-spear/debug-macro.S:#include arch/arm/plat-spear/include/plat-spear/uncompress.h:#include arch/arm/plat-spear/pl080.c:#include arch/arm/plat-spear/pl080.c:#include arch/arm/plat-spear/restart.c:#include arch/arm/plat-spear/restart.c:#include arch/arm/plat-spear/time.c:#include arch/arm/plat-versatile/clock.c:#include arch/arm/plat-versatile/leds.c:#include arch/arm/plat-versatile/leds.c:#include drivers/ata/pata_at32.c:#include drivers/ata/pata_at32.c:#include drivers/ata/pata_ep93xx.c:#include drivers/ata/pata_ep93xx.c:#include drivers/cdrom/gdrom.c:#include drivers/cdrom/gdrom.c:#include drivers/clk/spear/spear1310_clock.c:#include drivers/clk/spear/spear1340_clock.c:#include drivers/clk/spear/spear3xx_clock.c:#include drivers/clk/spear/spear6xx_clock.c:#include drivers/clk/versatile/clk-integrator.c:#include drivers/clk/versatile/clk-integrator.c:#include drivers/cpufreq/s5pv210-cpufreq.c:#include drivers/crypto/ux500/cryp/cryp.c:#include drivers/dma/iop-adma.c:#include drivers/dma/tegra20-apb-dma.c:#include drivers/gpio/gpio-sa1100.c:#include drivers/gpio/gpio-sa1100.c:#include drivers/gpio/gpio-samsung.c:#include drivers/gpio/gpio-samsung.c:#include drivers/gpio/gpio-samsung.c:#include drivers/gpio/gpio-samsung.c:#include drivers/i2c/busses/i2c-puv3.c:#include drivers/input/keyboard/bf54x-keys.c:#include drivers/input/keyboard/omap-keypad.c:#include drivers/input/keyboard/pxa27x_keypad.c:#include drivers/input/serio/i8042-unicore32io.h:#include drivers/input/touchscreen/hp680_ts_input.c:#include drivers/leds/leds-hp6xx.c:#include drivers/leds/leds-locomo.c:#include drivers/media/video/s5p-tv/sii9234_drv.c:#include drivers/mmc/host/atmel-mci.c:#include drivers/mmc/host/atmel-mci.c:#include drivers/mmc/host/atmel-mci.c:#include drivers/mtd/maps/ixp2000.c:#include drivers/mtd/nand/atmel_nand.c:#include drivers/mtd/nand/h1910.c:#include drivers/mtd/nand/h1910.c:#include drivers/mtd/nand/h1910.c:#include drivers/mtd/nand/orion_nand.c:#include drivers/mtd/nand/pxa3xx_nand.c:#include drivers/net/caif/caif_shm_u5500.c:#include drivers/net/ethernet/adi/bfin_mac.c:#include drivers/pcmcia/pxa2xx_sharpsl.c:#include drivers/pcmcia/sa1111_generic.c:#include drivers/pcmcia/soc_common.c:#include drivers/pwm/pwm-samsung.c:#include drivers/rtc/rtc-ds1302.c:#include drivers/rtc/rtc-puv3.c:#include drivers/rtc/rtc-s3c.c:#include drivers/rtc/rtc-sa1100.c:#include drivers/rtc/rtc-sa1100.c:#include drivers/rtc/rtc-sa1100.c:#include drivers/sh/maple/maple.c:#include drivers/sh/maple/maple.c:#include drivers/spi/spi-atmel.c:#include drivers/spi/spi-atmel.c:#include drivers/spi/spi-s3c64xx.c:#include drivers/spi/spi-stmp.c:#include drivers/spi/spi-stmp.c:#include drivers/spi/spi-stmp.c:#include drivers/spi/spi-stmp.c:#include drivers/spi/spi-stmp.c:#include drivers/tty/serial/atmel_serial.c:#include drivers/tty/serial/samsung.c:#include drivers/tty/serial/samsung.c:#include drivers/usb/gadget/lpc32xx_udc.c:#include drivers/usb/gadget/lpc32xx_udc.c:#include drivers/usb/gadget/lpc32xx_udc.c:#include drivers/usb/gadget/lpc32xx_udc.c:#include drivers/usb/gadget/omap_udc.c:#include drivers/usb/gadget/s3c-hsotg.c:#include drivers/usb/gadget/s3c2410_udc.c:#include drivers/usb/gadget/s3c2410_udc.c:#include drivers/usb/gadget/s3c2410_udc.c:#include drivers/usb/host/ohci-nxp.c:#include drivers/usb/host/ohci-nxp.c:#include drivers/usb/host/ohci-nxp.c:#include drivers/usb/host/ohci-omap.c:#include drivers/usb/host/ohci-omap.c:#include drivers/usb/host/ohci-omap.c:#include drivers/usb/otg/isp1301_omap.c:#include drivers/video/atmel_lcdfb.c:#include drivers/video/atmel_lcdfb.c:#include drivers/video/backlight/hp680_bl.c:#include drivers/video/bf54x-lq043fb.c:#include drivers/video/fb-puv3.c:#include drivers/video/pvr2fb.c:#include drivers/video/s3c-fb.c:#include drivers/video/s3c2410fb.c:#include drivers/video/s3c2410fb.c:#include drivers/video/s3c2410fb.c:#include drivers/watchdog/iop_wdt.c:#include drivers/watchdog/omap_wdt.c:#include drivers/watchdog/orion_wdt.c:#include drivers/watchdog/pnx4008_wdt.c:#include drivers/watchdog/s3c2410_wdt.c:#include drivers/watchdog/sa1100_wdt.c:#include drivers/watchdog/sa1100_wdt.c:#include drivers/watchdog/sa1100_wdt.c:#include drivers/watchdog/stmp3xxx_wdt.c:#include drivers/watchdog/stmp3xxx_wdt.c:#include include/linux/maple.h:#include sound/sh/aica.c:#include sound/sh/sh_dac_audio.c:#include sound/soc/fsl/imx-pcm-dma.c:#include sound/soc/fsl/imx-ssi.h:#include sound/soc/samsung/ac97.c:#include sound/soc/samsung/dma.c:#include sound/soc/samsung/dma.c:#include sound/soc/samsung/goni_wm8994.c:#include sound/soc/samsung/s3c-i2s-v2.c:#include sound/soc/samsung/s3c2412-i2s.c:#include sound/soc/samsung/s3c24xx-i2s.c:#include sound/soc/samsung/spdif.c:#include -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/