Skip to contentSkip to conversation

spi: reorganize drivers

PATCH Superseded Grant Likely 11 participants 25 messages Jun 5, 2011 – Jun 6, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: reorganize drivers

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file.

---
 drivers/spi/Makefile            |   80 ++++++++-----------
 drivers/spi/atmel_spi.h         |  167 ---------------------------------------
 drivers/spi/spi_ath79.c         |    0 
 drivers/spi/spi_atmel.c         |  155 ++++++++++++++++++++++++++++++++++++
 drivers/spi/spi_au1550.c        |    0 
 drivers/spi/spi_coldfire_qspi.c |    0 
 drivers/spi/spi_davinci.c       |    0 
 drivers/spi/spi_dw.c            |    2 
 drivers/spi/spi_dw.h            |    0 
 drivers/spi/spi_dw_mid.c        |    2 
 drivers/spi/spi_dw_mmio.c       |    2 
 drivers/spi/spi_dw_pci.c        |    2 
 drivers/spi/spi_ep93xx.c        |    0 
 drivers/spi/spi_mpc512x_psc.c   |    0 
 drivers/spi/spi_mpc52xx.c       |    0 
 drivers/spi/spi_mpc52xx_psc.c   |    0 
 drivers/spi/spi_omap2_mcspi.c   |    0 
 drivers/spi/spi_omap_100k.c     |    0 
 drivers/spi/spi_omap_uwire.c    |    0 
 drivers/spi/spi_orion.c         |    0 
 drivers/spi/spi_pl022.c         |    0 
 drivers/spi/spi_pxa2xx.c        |    0 
 drivers/spi/spi_pxa2xx_pci.c    |    0 
 drivers/spi/spi_ti_ssp.c        |    0 
 drivers/spi/spi_tle62x0.c       |    0 
 drivers/spi/spi_xilinx.c        |    0 
 26 files changed, 192 insertions(+), 218 deletions(-)
 delete mode 100644 drivers/spi/atmel_spi.h
 rename drivers/spi/{ath79_spi.c => spi_ath79.c} (100%)
 rename drivers/spi/{atmel_spi.c => spi_atmel.c} (85%)
 rename drivers/spi/{au1550_spi.c => spi_au1550.c} (100%)
 rename drivers/spi/{coldfire_qspi.c => spi_coldfire_qspi.c} (100%)
 rename drivers/spi/{davinci_spi.c => spi_davinci.c} (100%)
 rename drivers/spi/{dw_spi.c => spi_dw.c} (99%)
 rename drivers/spi/{dw_spi.h => spi_dw.h} (100%)
 rename drivers/spi/{dw_spi_mid.c => spi_dw_mid.c} (99%)
 rename drivers/spi/{dw_spi_mmio.c => spi_dw_mmio.c} (99%)
 rename drivers/spi/{dw_spi_pci.c => spi_dw_pci.c} (99%)
 rename drivers/spi/{ep93xx_spi.c => spi_ep93xx.c} (100%)
 rename drivers/spi/{mpc512x_psc_spi.c => spi_mpc512x_psc.c} (100%)
 rename drivers/spi/{mpc52xx_spi.c => spi_mpc52xx.c} (100%)
 rename drivers/spi/{mpc52xx_psc_spi.c => spi_mpc52xx_psc.c} (100%)
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)
drivers/spi/Makefile +34 -46
index 0f8c69b..39ab8e3 100644
@@ -7,68 +7,56 @@ ccflags-$(CONFIG_SPI_DEBUG) := -DDEBUG
 # small core, mostly translating board-specific
 # config declarations into driver model code
 obj-$(CONFIG_SPI_MASTER)		+= spi.o
+obj-$(CONFIG_SPI_SPIDEV)		+= spidev.o
 
 # SPI master controller drivers (bus)
 obj-$(CONFIG_SPI_ALTERA)		+= spi_altera.o
-obj-$(CONFIG_SPI_ATMEL)			+= atmel_spi.o
-obj-$(CONFIG_SPI_ATH79)			+= ath79_spi.o
+obj-$(CONFIG_SPI_ATMEL)			+= spi_atmel.o
+obj-$(CONFIG_SPI_ATH79)			+= spi_ath79.o
+obj-$(CONFIG_SPI_AU1550)		+= spi_au1550.o
 obj-$(CONFIG_SPI_BFIN)			+= spi_bfin5xx.o
 obj-$(CONFIG_SPI_BFIN_SPORT)		+= spi_bfin_sport.o
 obj-$(CONFIG_SPI_BITBANG)		+= spi_bitbang.o
-obj-$(CONFIG_SPI_AU1550)		+= au1550_spi.o
 obj-$(CONFIG_SPI_BUTTERFLY)		+= spi_butterfly.o
-obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= coldfire_qspi.o
-obj-$(CONFIG_SPI_DAVINCI)		+= davinci_spi.o
-obj-$(CONFIG_SPI_DESIGNWARE)		+= dw_spi.o
-obj-$(CONFIG_SPI_DW_PCI)		+= dw_spi_midpci.o
-dw_spi_midpci-objs			:= dw_spi_pci.o dw_spi_mid.o
-obj-$(CONFIG_SPI_DW_MMIO)		+= dw_spi_mmio.o
-obj-$(CONFIG_SPI_EP93XX)		+= ep93xx_spi.o
+obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= spi_coldfire_qspi.o
+obj-$(CONFIG_SPI_DAVINCI)		+= spi_davinci.o
+obj-$(CONFIG_SPI_DESIGNWARE)		+= spi_dw.o
+obj-$(CONFIG_SPI_DW_MMIO)		+= spi_dw_mmio.o
+obj-$(CONFIG_SPI_DW_PCI)		+= spi_dw_midpci.o
+spi_dw_midpci-objs			:= spi_dw_pci.o spi_dw_mid.o
+obj-$(CONFIG_SPI_EP93XX)		+= spi_ep93xx.o
+obj-$(CONFIG_SPI_FSL_LIB)		+= spi_fsl_lib.o
+obj-$(CONFIG_SPI_FSL_ESPI)		+= spi_fsl_espi.o
+obj-$(CONFIG_SPI_FSL_SPI)		+= spi_fsl_spi.o
 obj-$(CONFIG_SPI_GPIO)			+= spi_gpio.o
 obj-$(CONFIG_SPI_IMX)			+= spi_imx.o
 obj-$(CONFIG_SPI_LM70_LLP)		+= spi_lm70llp.o
-obj-$(CONFIG_SPI_PXA2XX)		+= pxa2xx_spi.o
-obj-$(CONFIG_SPI_PXA2XX_PCI)		+= pxa2xx_spi_pci.o
+obj-$(CONFIG_SPI_MPC512x_PSC)		+= spi_mpc512x_psc.o
+obj-$(CONFIG_SPI_MPC52xx_PSC)		+= spi_mpc52xx_psc.o
+obj-$(CONFIG_SPI_MPC52xx)		+= spi_mpc52xx.o
+obj-$(CONFIG_SPI_NUC900)		+= spi_nuc900.o
 obj-$(CONFIG_SPI_OC_TINY)		+= spi_oc_tiny.o
-obj-$(CONFIG_SPI_OMAP_UWIRE)		+= omap_uwire.o
-obj-$(CONFIG_SPI_OMAP24XX)		+= omap2_mcspi.o
-obj-$(CONFIG_SPI_OMAP_100K)		+= omap_spi_100k.o
-obj-$(CONFIG_SPI_ORION)			+= orion_spi.o
-obj-$(CONFIG_SPI_PL022)			+= amba-pl022.o
-obj-$(CONFIG_SPI_MPC512x_PSC)		+= mpc512x_psc_spi.o
-obj-$(CONFIG_SPI_MPC52xx_PSC)		+= mpc52xx_psc_spi.o
-obj-$(CONFIG_SPI_MPC52xx)		+= mpc52xx_spi.o
-obj-$(CONFIG_SPI_FSL_LIB)		+= spi_fsl_lib.o
-obj-$(CONFIG_SPI_FSL_ESPI)		+= spi_fsl_espi.o
-obj-$(CONFIG_SPI_FSL_SPI)		+= spi_fsl_spi.o
+obj-$(CONFIG_SPI_OMAP_UWIRE)		+= spi_omap_uwire.o
+obj-$(CONFIG_SPI_OMAP_100K)		+= spi_omap_100k.o
+obj-$(CONFIG_SPI_OMAP24XX)		+= spi_omap2_mcspi.o
+obj-$(CONFIG_SPI_ORION)			+= spi_orion.o
+obj-$(CONFIG_SPI_PL022)			+= spi_pl022.o
 obj-$(CONFIG_SPI_PPC4xx)		+= spi_ppc4xx.o
+obj-$(CONFIG_SPI_PXA2XX)		+= spi_pxa2xx.o
+obj-$(CONFIG_SPI_PXA2XX_PCI)		+= spi_pxa2xx_pci.o
 obj-$(CONFIG_SPI_S3C24XX_GPIO)		+= spi_s3c24xx_gpio.o
 obj-$(CONFIG_SPI_S3C24XX)		+= spi_s3c24xx_hw.o
+spi_s3c24xx_hw-y			:= spi_s3c24xx.o
+spi_s3c24xx_hw-$(CONFIG_SPI_S3C24XX_FIQ) += spi_s3c24xx_fiq.o
 obj-$(CONFIG_SPI_S3C64XX)		+= spi_s3c64xx.o
-obj-$(CONFIG_SPI_TEGRA)			+= spi_tegra.o
-obj-$(CONFIG_SPI_TI_SSP)		+= ti-ssp-spi.o
-obj-$(CONFIG_SPI_TOPCLIFF_PCH)		+= spi_topcliff_pch.o
-obj-$(CONFIG_SPI_TXX9)			+= spi_txx9.o
-obj-$(CONFIG_SPI_XILINX)		+= xilinx_spi.o
 obj-$(CONFIG_SPI_SH)			+= spi_sh.o
-obj-$(CONFIG_SPI_SH_SCI)		+= spi_sh_sci.o
 obj-$(CONFIG_SPI_SH_MSIOF)		+= spi_sh_msiof.o
+obj-$(CONFIG_SPI_SH_SCI)		+= spi_sh_sci.o
 obj-$(CONFIG_SPI_STMP3XXX)		+= spi_stmp.o
-obj-$(CONFIG_SPI_NUC900)		+= spi_nuc900.o
-
-# special build for s3c24xx spi driver with fiq support
-spi_s3c24xx_hw-y			:= spi_s3c24xx.o
-spi_s3c24xx_hw-$(CONFIG_SPI_S3C24XX_FIQ) += spi_s3c24xx_fiq.o
-
-# 	... add above this line ...
-
-# SPI protocol drivers (device/link on bus)
-obj-$(CONFIG_SPI_SPIDEV)	+= spidev.o
-obj-$(CONFIG_SPI_TLE62X0)	+= tle62x0.o
-# 	... add above this line ...
-
-# SPI slave controller drivers (upstream link)
-# 	... add above this line ...
+obj-$(CONFIG_SPI_TEGRA)			+= spi_tegra.o
+obj-$(CONFIG_SPI_TI_SSP)		+= spi_ti_ssp.o
+obj-$(CONFIG_SPI_TLE62X0)	+= spi_tle62x0.o
+obj-$(CONFIG_SPI_TOPCLIFF_PCH)		+= spi_topcliff_pch.o
+obj-$(CONFIG_SPI_TXX9)			+= spi_txx9.o
+obj-$(CONFIG_SPI_XILINX)		+= spi_xilinx.o
 
-# SPI slave drivers (protocol for that link)
-# 	... add above this line ...
drivers/spi/atmel_spi.h deleted +0 -167

167 lines not on this page · raw message

drivers/spi/spi_ath79.c renamed from drivers/spi/ath79_spi.c +0 -0
similarity index 100%
rename from drivers/spi/ath79_spi.c
rename to drivers/spi/spi_ath79.c
drivers/spi/spi_atmel.c renamed from drivers/spi/atmel_spi.c +154 -1

161 lines not on this page · raw message

drivers/spi/spi_au1550.c renamed from drivers/spi/au1550_spi.c +0 -0
similarity index 100%
rename from drivers/spi/au1550_spi.c
rename to drivers/spi/spi_au1550.c
drivers/spi/spi_coldfire_qspi.c renamed from drivers/spi/coldfire_qspi.c +0 -0
similarity index 100%
rename from drivers/spi/coldfire_qspi.c
rename to drivers/spi/spi_coldfire_qspi.c
drivers/spi/spi_davinci.c renamed from drivers/spi/davinci_spi.c +0 -0
similarity index 100%
rename from drivers/spi/davinci_spi.c
rename to drivers/spi/spi_davinci.c
drivers/spi/spi_dw.c renamed from drivers/spi/dw_spi.c +1 -1
similarity index 99%
rename from drivers/spi/dw_spi.c
rename to drivers/spi/spi_dw.c
index 919fa9d..33b2b76 100644
@@ -24,7 +24,7 @@
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
 
-#include "dw_spi.h"
+#include "spi_dw.h"
 
 #ifdef CONFIG_DEBUG_FS
 #include <linux/debugfs.h>
drivers/spi/spi_dw.h renamed from drivers/spi/dw_spi.h +0 -0
similarity index 100%
rename from drivers/spi/dw_spi.h
rename to drivers/spi/spi_dw.h
drivers/spi/spi_dw_mid.c renamed from drivers/spi/dw_spi_mid.c +1 -1
similarity index 99%
rename from drivers/spi/dw_spi_mid.c
rename to drivers/spi/spi_dw_mid.c
index 4891782..83311f8 100644
@@ -23,7 +23,7 @@
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
 
-#include "dw_spi.h"
+#include "spi_dw.h"
 
 #ifdef CONFIG_SPI_DW_MID_DMA
 #include <linux/intel_mid_dma.h>
drivers/spi/spi_dw_mmio.c renamed from drivers/spi/dw_spi_mmio.c +1 -1
similarity index 99%
rename from drivers/spi/dw_spi_mmio.c
rename to drivers/spi/spi_dw_mmio.c
index e0e813d..9f0a2ce 100644
@@ -16,7 +16,7 @@
 #include <linux/spi/spi.h>
 #include <linux/scatterlist.h>
 
-#include "dw_spi.h"
+#include "spi_dw.h"
 
 #define DRIVER_NAME "dw_spi_mmio"
 
drivers/spi/spi_dw_pci.c renamed from drivers/spi/dw_spi_pci.c +1 -1
similarity index 99%
rename from drivers/spi/dw_spi_pci.c
rename to drivers/spi/spi_dw_pci.c
index ad260aa..4877d1a 100644
@@ -22,7 +22,7 @@
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
 
-#include "dw_spi.h"
+#include "spi_dw.h"
 
 #define DRIVER_NAME "dw_spi_pci"
 
drivers/spi/spi_ep93xx.c renamed from drivers/spi/ep93xx_spi.c +0 -0
similarity index 100%
rename from drivers/spi/ep93xx_spi.c
rename to drivers/spi/spi_ep93xx.c
drivers/spi/spi_mpc512x_psc.c renamed from drivers/spi/mpc512x_psc_spi.c +0 -0
similarity index 100%
rename from drivers/spi/mpc512x_psc_spi.c
rename to drivers/spi/spi_mpc512x_psc.c
drivers/spi/spi_mpc52xx.c renamed from drivers/spi/mpc52xx_spi.c +0 -0
similarity index 100%
rename from drivers/spi/mpc52xx_spi.c
rename to drivers/spi/spi_mpc52xx.c
drivers/spi/spi_mpc52xx_psc.c renamed from drivers/spi/mpc52xx_psc_spi.c +0 -0
similarity index 100%
rename from drivers/spi/mpc52xx_psc_spi.c
rename to drivers/spi/spi_mpc52xx_psc.c
drivers/spi/spi_omap2_mcspi.c renamed from drivers/spi/omap2_mcspi.c +0 -0
similarity index 100%
rename from drivers/spi/omap2_mcspi.c
rename to drivers/spi/spi_omap2_mcspi.c
drivers/spi/spi_omap_100k.c renamed from drivers/spi/omap_spi_100k.c +0 -0
similarity index 100%
rename from drivers/spi/omap_spi_100k.c
rename to drivers/spi/spi_omap_100k.c
drivers/spi/spi_omap_uwire.c renamed from drivers/spi/omap_uwire.c +0 -0
similarity index 100%
rename from drivers/spi/omap_uwire.c
rename to drivers/spi/spi_omap_uwire.c
drivers/spi/spi_orion.c renamed from drivers/spi/orion_spi.c +0 -0
similarity index 100%
rename from drivers/spi/orion_spi.c
rename to drivers/spi/spi_orion.c
drivers/spi/spi_pl022.c renamed from drivers/spi/amba-pl022.c +0 -0
similarity index 100%
rename from drivers/spi/amba-pl022.c
rename to drivers/spi/spi_pl022.c
drivers/spi/spi_pxa2xx.c renamed from drivers/spi/pxa2xx_spi.c +0 -0
similarity index 100%
rename from drivers/spi/pxa2xx_spi.c
rename to drivers/spi/spi_pxa2xx.c
drivers/spi/spi_pxa2xx_pci.c renamed from drivers/spi/pxa2xx_spi_pci.c +0 -0
similarity index 100%
rename from drivers/spi/pxa2xx_spi_pci.c
rename to drivers/spi/spi_pxa2xx_pci.c
drivers/spi/spi_ti_ssp.c renamed from drivers/spi/ti-ssp-spi.c +0 -0
similarity index 100%
rename from drivers/spi/ti-ssp-spi.c
rename to drivers/spi/spi_ti_ssp.c
drivers/spi/spi_tle62x0.c renamed from drivers/spi/tle62x0.c +0 -0
similarity index 100%
rename from drivers/spi/tle62x0.c
rename to drivers/spi/spi_tle62x0.c
drivers/spi/spi_xilinx.c renamed from drivers/spi/xilinx_spi.c +0 -0
similarity index 100%
rename from drivers/spi/xilinx_spi.c
rename to drivers/spi/spi_xilinx.c
#1 lore raw
Quoted 29 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file.

---
 drivers/spi/Makefile            |   80 ++++++++-----------

 drivers/spi/atmel_spi.h         |  167 ---------------------------------------
 drivers/spi/spi_ath79.c         |    0
 drivers/spi/spi_atmel.c         |  155 ++++++++++++++++++++++++++++++++++++
 drivers/spi/spi_au1550.c        |    0

 drivers/spi/spi_coldfire_qspi.c |    0
 drivers/spi/spi_davinci.c       |    0
 drivers/spi/spi_dw.c            |    2
 drivers/spi/spi_dw.h            |    0
 drivers/spi/spi_dw_mid.c        |    2
 drivers/spi/spi_dw_mmio.c       |    2
 drivers/spi/spi_dw_pci.c        |    2
 drivers/spi/spi_ep93xx.c        |    0
 drivers/spi/spi_mpc512x_psc.c   |    0
 drivers/spi/spi_mpc52xx.c       |    0
 drivers/spi/spi_mpc52xx_psc.c   |    0
 drivers/spi/spi_omap2_mcspi.c   |    0
 drivers/spi/spi_omap_100k.c     |    0
 drivers/spi/spi_omap_uwire.c    |    0

Quoted 7 lines
 drivers/spi/spi_orion.c         |    0
 drivers/spi/spi_pl022.c         |    0
 drivers/spi/spi_pxa2xx.c        |    0

 drivers/spi/spi_pxa2xx_pci.c    |    0
 drivers/spi/spi_ti_ssp.c        |    0
 drivers/spi/spi_tle62x0.c       |    0
 drivers/spi/spi_xilinx.c        |    0

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

#2 lore raw

Hi Jassi,

Quoted 5 lines · Jassi Brar
Quoted 4 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

[snip]

Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

baruch

Signature · 10 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
#3 lore raw
Quoted 7 lines · Baruch Siach
Quoted 5 lines · Jassi Brar
Quoted 4 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

Quoted 8 lines

[snip]

Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Plus, when dropping the prefix, spi_xilinx.ko and gpio-xilinx.ko become the same...

So now we have spi_<name>.c (with underscore) and gpio-<name>.c (with dash)? And other subsystems go with <name>-<type>.c instead, e.g. drivers/mfd/wm831x-spi.c?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#4 lore raw
Quoted 14 lines · On Jun 05 Geert Uytterhoeven wrote:
Quoted 13 lines · Baruch Siach
Quoted 5 lines · Jassi Brar
Quoted 4 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

[snip]

Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

Quoted 5 lines
Quoted 2 lines

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Plus, when dropping the prefix, spi_xilinx.ko and gpio-xilinx.ko become the same...

In drivers/firewire/Makefile for example, there is this:

	firewire-core-y += core-card.o core-cdev.o core-device.o \
	                   core-iso.o core-topology.o core-transaction.o
	firewire-ohci-y += ohci.o
	firewire-sbp2-y += sbp2.o
	firewire-net-y  += net.o

Which is impractical though if there are more than a handful of drivers involved.

Signature · 3 lines
Stefan Richter
-=====-==-== -==- --=-=
http://arcgraph.de/sr/
#5 lore raw
In reply to Geert Uytterhoeven
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Baruch Siach
Quoted 5 lines · Jassi Brar
Quoted 4 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

[snip]

Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

Quoted 5 lines
Quoted 2 lines

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Plus, when dropping the prefix, spi_xilinx.ko and gpio-xilinx.ko become the same...

Exactly. We essentially have a flat namespace for modules, despite the fact of them being organized into directories. At least for the subsystems I maintain, I'd like to have a consistent prefix for that reason.

Quoted 3 lines

So now we have spi_<name>.c (with underscore) and gpio-<name>.c (with dash)? And other subsystems go with <name>-<type>.c instead, e.g. drivers/mfd/wm831x-spi.c?

On a brief survey of drivers:

apci: *.c
ata: pata_*.c, sata_*.c
atm: *.c
block: *.c
bluetooth: *.c
crypto: *.c
dma: *dma.c
gpio: gpio-*.c (after applying my patch)
hid: hid-*.c
hwmon: *.c
i2c: i2c-*.c
ide: *.c and ide-*.c
input: *.c
leds: leds-*.c
mca: mca-*.c
md: largely dm-*.c
mfd: *.c
mmc: *.c
mtd: *.c
net: *.c
rtc: rtc-*.c
scsi: *.c and scsi_*.c for core code
spi: (before patch) mix of spi_*.c and *_spi.c and *.c
uio: uio_*.c
virtio: virtio_*.c
wdt: *wdt.c and *_wdt.c

So, in this (admittedly incomplete) survey, I see 5 users of the "prefix_" pattern, 8 of the "prefix-" pattern, a small number using a suffix, and a whole lot without any pattern at all. Personally, I prefer the using a prefix with a '-', but in the spi directory there was already a number of drivers using '_', so it was smaller impact to change to using that instead of a dash. If people don't think it is a big deal though, then I'll change it to '-' to match the gpio change.

g.

#6 lore raw
Quoted 10 lines · Geert Uytterhoeven
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Plus, when dropping the prefix, spi_xilinx.ko and gpio-xilinx.ko become the same...

As I said, the modules could still be made spi_xilinx.ko from drivers/spi/xilinx.c
and gpio_xilinx.ko from drivers/gpio/xilinx.c

Quoted 5 lines · Grant Likely
Quoted 2 lines

Perhaps we could get Makefile to build modules with spi_ prefix. Just like USB gadgets do ?

I don't think it's worth mucking about with <module_name>-y := filename.o when the filename can just be made the same as the module name.

Well, the solution was for discarding the 'redundant' prefix and yet have device specific
module names. Not just for the sake of it.

Anyways, I don't wanna be bitchy about it. I can buy at face value from a maintainer.
I am ok with the proposed naming.

Cheers!
-j

#7 lore raw
In reply to Baruch Siach

Hi Baruch,

Quoted 6 lines · Baruch Siach
Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Good catch.
Perhaps we could get Makefile to build modules with spi_ prefix. Just like USB gadgets do ?

#8 lore raw
Quoted 7 lines · Jassi Brar

Hi Baruch,

Quoted 4 lines · Baruch Siach
Quoted 3 lines

Though the spi_ prefix seems redundant considering the files are in 'spi' directory.
Just a thought, no objection.

Quoted 5 lines
Quoted 2 lines

When looking at the list of loaded modules (e.g. in an Oops message), the name "spi_xilinx" is much more meaningful than just "xilinx", for example.

Good catch.
Perhaps we could get Makefile to build modules with spi_ prefix. Just like USB gadgets do ?

I don't think it's worth mucking about with <module_name>-y := filename.o when the filename can just be made the same as the module name.

g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#9 lore raw
In reply to Grant Likely
Quoted 54 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file.

---
 drivers/spi/Makefile            |   80 ++++++++-----------
 drivers/spi/atmel_spi.h         |  167 ---------------------------------------
 drivers/spi/spi_ath79.c         |    0 
 drivers/spi/spi_atmel.c         |  155 ++++++++++++++++++++++++++++++++++++
 drivers/spi/spi_au1550.c        |    0 
 drivers/spi/spi_coldfire_qspi.c |    0 
 drivers/spi/spi_davinci.c       |    0 
 drivers/spi/spi_dw.c            |    2 
 drivers/spi/spi_dw.h            |    0 
 drivers/spi/spi_dw_mid.c        |    2 
 drivers/spi/spi_dw_mmio.c       |    2 
 drivers/spi/spi_dw_pci.c        |    2 
 drivers/spi/spi_ep93xx.c        |    0 
 drivers/spi/spi_mpc512x_psc.c   |    0 
 drivers/spi/spi_mpc52xx.c       |    0 
 drivers/spi/spi_mpc52xx_psc.c   |    0 
 drivers/spi/spi_omap2_mcspi.c   |    0 
 drivers/spi/spi_omap_100k.c     |    0 
 drivers/spi/spi_omap_uwire.c    |    0 
 drivers/spi/spi_orion.c         |    0 
 drivers/spi/spi_pl022.c         |    0 
 drivers/spi/spi_pxa2xx.c        |    0 
 drivers/spi/spi_pxa2xx_pci.c    |    0 
 drivers/spi/spi_ti_ssp.c        |    0 
 drivers/spi/spi_tle62x0.c       |    0 
 drivers/spi/spi_xilinx.c        |    0 
 26 files changed, 192 insertions(+), 218 deletions(-)
 delete mode 100644 drivers/spi/atmel_spi.h
 rename drivers/spi/{ath79_spi.c => spi_ath79.c} (100%)
 rename drivers/spi/{atmel_spi.c => spi_atmel.c} (85%)
 rename drivers/spi/{au1550_spi.c => spi_au1550.c} (100%)
 rename drivers/spi/{coldfire_qspi.c => spi_coldfire_qspi.c} (100%)
 rename drivers/spi/{davinci_spi.c => spi_davinci.c} (100%)
 rename drivers/spi/{dw_spi.c => spi_dw.c} (99%)
 rename drivers/spi/{dw_spi.h => spi_dw.h} (100%)
 rename drivers/spi/{dw_spi_mid.c => spi_dw_mid.c} (99%)
 rename drivers/spi/{dw_spi_mmio.c => spi_dw_mmio.c} (99%)
 rename drivers/spi/{dw_spi_pci.c => spi_dw_pci.c} (99%)
 rename drivers/spi/{ep93xx_spi.c => spi_ep93xx.c} (100%)
 rename drivers/spi/{mpc512x_psc_spi.c => spi_mpc512x_psc.c} (100%)
 rename drivers/spi/{mpc52xx_spi.c => spi_mpc52xx.c} (100%)
 rename drivers/spi/{mpc52xx_psc_spi.c => spi_mpc52xx_psc.c} (100%)
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
Quoted 8 lines
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

We also have things like this in drivers/spi/Kconfig:

config SPI_DAVINCI
...

This driver can also be built as a module. The module will be called davinci_spi <--- This is now wrong

should these be converted as well?

#10 lore raw
Quoted 66 lines · Mika Westerberg
Quoted 54 lines · Grant Likely

[repost: I had a typo on the spi-devel-general mailing list address]

Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers.

This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file.

---
 drivers/spi/Makefile            |   80 ++++++++-----------

 drivers/spi/atmel_spi.h         |  167 ---------------------------------------
 drivers/spi/spi_ath79.c         |    0
 drivers/spi/spi_atmel.c         |  155 ++++++++++++++++++++++++++++++++++++
 drivers/spi/spi_au1550.c        |    0

 drivers/spi/spi_coldfire_qspi.c |    0
 drivers/spi/spi_davinci.c       |    0
 drivers/spi/spi_dw.c            |    2
 drivers/spi/spi_dw.h            |    0
 drivers/spi/spi_dw_mid.c        |    2
 drivers/spi/spi_dw_mmio.c       |    2
 drivers/spi/spi_dw_pci.c        |    2
 drivers/spi/spi_ep93xx.c        |    0
 drivers/spi/spi_mpc512x_psc.c   |    0
 drivers/spi/spi_mpc52xx.c       |    0
 drivers/spi/spi_mpc52xx_psc.c   |    0
 drivers/spi/spi_omap2_mcspi.c   |    0
 drivers/spi/spi_omap_100k.c     |    0
 drivers/spi/spi_omap_uwire.c    |    0

 drivers/spi/spi_orion.c         |    0
 drivers/spi/spi_pl022.c         |    0
 drivers/spi/spi_pxa2xx.c        |    0

 drivers/spi/spi_pxa2xx_pci.c    |    0
 drivers/spi/spi_ti_ssp.c        |    0
 drivers/spi/spi_tle62x0.c       |    0
 drivers/spi/spi_xilinx.c        |    0

 26 files changed, 192 insertions(+), 218 deletions(-)

 delete mode 100644 drivers/spi/atmel_spi.h
 rename drivers/spi/{ath79_spi.c => spi_ath79.c} (100%) rename drivers/spi/{atmel_spi.c => spi_atmel.c} (85%) rename drivers/spi/{au1550_spi.c => spi_au1550.c} (100%) rename drivers/spi/{coldfire_qspi.c => spi_coldfire_qspi.c} (100%) rename drivers/spi/{davinci_spi.c => spi_davinci.c} (100%) rename drivers/spi/{dw_spi.c => spi_dw.c} (99%)
 rename drivers/spi/{dw_spi.h => spi_dw.h} (100%)
 rename drivers/spi/{dw_spi_mid.c => spi_dw_mid.c} (99%) rename drivers/spi/{dw_spi_mmio.c => spi_dw_mmio.c} (99%) rename drivers/spi/{dw_spi_pci.c => spi_dw_pci.c} (99%) rename drivers/spi/{ep93xx_spi.c => spi_ep93xx.c} (100%) rename drivers/spi/{mpc512x_psc_spi.c => spi_mpc512x_psc.c} (100%) rename drivers/spi/{mpc52xx_spi.c => spi_mpc52xx.c} (100%) rename drivers/spi/{mpc52xx_psc_spi.c => spi_mpc52xx_psc.c} (100%) rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%) rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)

Quoted 8 lines

 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%) rename drivers/spi/{orion_spi.c => spi_orion.c} (100%) rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%) rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%) rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%) rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%) rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%) rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

We also have things like this in drivers/spi/Kconfig:

Quoted 7 lines

config SPI_DAVINCI
       ...

       This driver can also be built as a module. The module will be called davinci_spi <--- This is now wrong

should these be converted as well?

yes.

g.

#11 lore raw
In reply to Grant Likely
Quoted 10 lines · Grant Likely
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

Specifically, I'd like to do these moves:

drivers/{ => bus}/amba
drivers/{ => bus}/dio
drivers/{ => bus}/eisa
drivers/{ => bus}/firewire
drivers/{ => bus}/i2c
drivers/{ => bus}/mca
drivers/{ => bus}/nubus
drivers/{ => bus}/pcmcia
drivers/{ => bus}/rapidio
drivers/{ => bus}/sbus
drivers/{ => bus}/spi
drivers/{ => bus}/ssb
drivers/{ => bus}/tc
drivers/{ => bus}/uwb
drivers/{ => bus}/virtio
drivers/{ => bus}/vlync
drivers/{ => bus}/w1
drivers/{ => bus}/zorro

This leaves out the two most common buses, USB and PCI, mostly because the directories contain a lot of stuff that is not really bus code but actual drivers. It does include i2c and spi, which stick out by being a lot larger than most others.

Opinions? Move or don't move?

Arnd

#12 lore raw
Quoted 42 lines · Arnd Bergmann
Quoted 10 lines · Grant Likely
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

Specifically, I'd like to do these moves:

drivers/{ => bus}/amba
drivers/{ => bus}/dio
drivers/{ => bus}/eisa
drivers/{ => bus}/firewire
drivers/{ => bus}/i2c
drivers/{ => bus}/mca
drivers/{ => bus}/nubus
drivers/{ => bus}/pcmcia
drivers/{ => bus}/rapidio
drivers/{ => bus}/sbus
drivers/{ => bus}/spi
drivers/{ => bus}/ssb
drivers/{ => bus}/tc
drivers/{ => bus}/uwb
drivers/{ => bus}/virtio
drivers/{ => bus}/vlync
drivers/{ => bus}/w1
drivers/{ => bus}/zorro

Quoted 6 lines

This leaves out the two most common buses, USB and PCI, mostly because the directories contain a lot of stuff that is not really bus code but actual drivers. It does include i2c and spi, which stick out by being a lot larger than most others.

Opinions? Move or don't move?

For PCMCIA, you'd have my Acked-by, if it doesn't end up being the only directory being moved ;)

Best
Dominik

#13 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

This leaves out the two most common buses, USB and PCI, mostly because the directories contain a lot of stuff that is not really bus code but actual drivers. It does include i2c and spi, which stick out by being a lot larger than most others.

Opinions? Move or don't move?

I don't see much point in adding an additional level of directories. All that it'll do is add to the shell filename completion workload and wear out our tab keys faster...

We'll still have these directories with not a lot under them.

#14 lore raw
In reply to Arnd Bergmann
Quoted 42 lines · Arnd Bergmann
Quoted 10 lines · Grant Likely
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

Specifically, I'd like to do these moves:

drivers/{ => bus}/amba
drivers/{ => bus}/dio
drivers/{ => bus}/eisa
drivers/{ => bus}/firewire
drivers/{ => bus}/i2c
drivers/{ => bus}/mca
drivers/{ => bus}/nubus
drivers/{ => bus}/pcmcia
drivers/{ => bus}/rapidio
drivers/{ => bus}/sbus
drivers/{ => bus}/spi
drivers/{ => bus}/ssb
drivers/{ => bus}/tc
drivers/{ => bus}/uwb
drivers/{ => bus}/virtio
drivers/{ => bus}/vlync
drivers/{ => bus}/w1
drivers/{ => bus}/zorro

Quoted 6 lines

This leaves out the two most common buses, USB and PCI, mostly because the directories contain a lot of stuff that is not really bus code but actual drivers. It does include i2c and spi, which stick out by being a lot larger than most others.

Opinions? Move or don't move?

No opinion, I just don't care.

Signature · 1 line
Jean Delvare
#15 lore raw
In reply to Arnd Bergmann
Quoted 42 lines · Arnd Bergmann
Quoted 10 lines · Grant Likely
 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%)
 rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%)
 rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%)
 rename drivers/spi/{orion_spi.c => spi_orion.c} (100%)
 rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%)
 rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%)
 rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%)
 rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%)
 rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%)
 rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

Specifically, I'd like to do these moves:

drivers/{ => bus}/amba
drivers/{ => bus}/dio
drivers/{ => bus}/eisa
drivers/{ => bus}/firewire
drivers/{ => bus}/i2c
drivers/{ => bus}/mca
drivers/{ => bus}/nubus
drivers/{ => bus}/pcmcia
drivers/{ => bus}/rapidio
drivers/{ => bus}/sbus
drivers/{ => bus}/spi
drivers/{ => bus}/ssb
drivers/{ => bus}/tc
drivers/{ => bus}/uwb
drivers/{ => bus}/virtio
drivers/{ => bus}/vlync
drivers/{ => bus}/w1
drivers/{ => bus}/zorro

Quoted 6 lines

This leaves out the two most common buses, USB and PCI, mostly because the directories contain a lot of stuff that is not really bus code but actual drivers. It does include i2c and spi, which stick out by being a lot larger than most others.

Opinions? Move or don't move?

I'd say it only makes sense if we do it for all busses ... so USB and PCI would have to move too. Logically, the bus code should move and we should be left with the drivers in both of those directories. I'd also say that we don't have to deepen the tree: /bus would be fine. That way, /drivers/<bus> would be only for <bus> specific drivers, with non bus specific drivers we just group them by function as now.

What about the half busses (like SCSI)?

Finally, is there any real point (other than we can do it)? what is actually helped by having the bus code obviously separated from the driver code (assuming we sort out what is bus and what is driver)?

James

#16 lore raw
Quoted 6 lines · James Bottomley

I'd say it only makes sense if we do it for all busses ... so USB and PCI would have to move too. Logically, the bus code should move and we should be left with the drivers in both of those directories. I'd also say that we don't have to deepen the tree: /bus would be fine. That way, /drivers/<bus> would be only for <bus> specific drivers, with non bus specific drivers we just group them by function as now.

A top-level /bus would work for me, and I guess would also address Russell's concern. Regarding bus-specific drivers, we're gradually moving those out of the bus specific directories anyway, basically the only bus directory that really has device driver in it is USB at this point. It makes some sense to have a bus-specific low-level user space interface driver like sg or uio in the bus directory, but everything else should really belong into some other subsystem.

Quoted 1 line

What about the half busses (like SCSI)?

I think SCSI is a really special case, not just because of its size of more than twice the code than everything else I would suggest to move, but also because it contains mostly host drivers but very few device drivers (sd, sr, osst, st, and sg). In that sense it's more a class of devices than a bus and fits in the same category as mmc and ata than a bus like pci or i2c that have a multitude of device drivers.

Quoted 3 lines

Finally, is there any real point (other than we can do it)? what is actually helped by having the bus code obviously separated from the driver code (assuming we sort out what is bus and what is driver)?

Mostly I think the drivers/ subdirectory is getting a bit cluttered with stuff that doesn't really fit together, and bus drivers are typically directories with less than five files in them, apart from the few exceptions that already came up.

This is about to get worse as we introduce new subsystems (e.g. iommu, irq, clocksource, eeprom, nvram, ...) into which we are moving code from arch/arm, drivers/char and drivers/misc. Having buses and drivers in a separate hierarchy would make the drivers directory and the respective menuconfig list more clearly structured IMHO.

Arnd

#17 lore raw
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · James Bottomley

I'd say it only makes sense if we do it for all busses ... so USB and PCI would have to move too. Logically, the bus code should move and we should be left with the drivers in both of those directories. I'd also say that we don't have to deepen the tree: /bus would be fine. That way, /drivers/<bus> would be only for <bus> specific drivers, with non bus specific drivers we just group them by function as now.

Quoted 7 lines

A top-level /bus would work for me, and I guess would also address Russell's concern. Regarding bus-specific drivers, we're gradually moving those out of the bus specific directories anyway, basically the only bus directory that really has device driver in it is USB at this point. It makes some sense to have a bus-specific low-level user space interface driver like sg or uio in the bus directory, but everything else should really belong into some other subsystem.

Err, what about I2C and SPI? Aren't drivers/i2c/busses and drivers/spi full of "device drivers"? Or are these what you call "bus-specific drivers"? Maybe we need to define all the terms before the discussion continues further.

Quoted 6 lines

(...)
This is about to get worse as we introduce new subsystems (e.g. iommu, irq, clocksource, eeprom, nvram, ...) into which we are moving code from arch/arm, drivers/char and drivers/misc. Having buses and drivers in a separate hierarchy would make the drivers directory and the respective menuconfig list more clearly structured IMHO.

This gets interesting. Would you suggest for example that i2c-core.c goes to bus/i2c, and drivers/i2c/busses becomes drivers/i2c? And that CONFIG_I2C is somewhere in menuconfig, and the hardware driver selection for drivers/i2c is in a totally different place?

While I am surprised, I am not necessarily objecting. But it seems that you should better define what your actual plan is, before asking us if we agree with it.

Signature · 1 line
Jean Delvare
#18 lore raw
Quoted 17 lines · Jean Delvare
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · James Bottomley

I'd say it only makes sense if we do it for all busses ... so USB and PCI would have to move too.  Logically, the bus code should move and we should be left with the drivers in both of those directories.  I'd also say that we don't have to deepen the tree: /bus would be fine.  That way, /drivers/<bus> would be only for <bus> specific drivers, with non bus specific drivers we just group them by function as now.

Quoted 7 lines

A top-level /bus would work for me, and I guess would also address Russell's concern. Regarding bus-specific drivers, we're gradually moving those out of the bus specific directories anyway, basically the only bus directory that really has device driver in it is USB at this point. It makes some sense to have a bus-specific low-level user space interface driver like sg or uio in the bus directory, but everything else should really belong into some other subsystem.

Quoted 4 lines

Err, what about I2C and SPI? Aren't drivers/i2c/busses and drivers/spi full of "device drivers"? Or are these what you call "bus-specific drivers"? Maybe we need to define all the terms before the discussion continues further.

Arnd did write:

| It does include i2c and spi, which stick out by being a lot larger than most others.

Quoted 7 lines
Quoted 6 lines

(...)
This is about to get worse as we introduce new subsystems (e.g. iommu, irq, clocksource, eeprom, nvram, ...) into which we are moving code from arch/arm, drivers/char and drivers/misc. Having buses and drivers in a separate hierarchy would make the drivers directory and the respective menuconfig list more clearly structured IMHO.

Quoted 8 lines

This gets interesting. Would you suggest for example that i2c-core.c goes to bus/i2c, and drivers/i2c/busses becomes drivers/i2c? And that CONFIG_I2C is somewhere in menuconfig, and the hardware driver selection for drivers/i2c is in a totally different place?

While I am surprised, I am not necessarily objecting. But it seems that you should better define what your actual plan is, before asking us if we agree with it.

Most other drivers are located based use case, i.e. from the user's point of view,
e.g. drivers/net/ and drivers/video.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia

#19 lore raw
In reply to Jean Delvare
Quoted 9 lines · Jean Delvare
Quoted 7 lines · Arnd Bergmann

A top-level /bus would work for me, and I guess would also address Russell's concern. Regarding bus-specific drivers, we're gradually moving those out of the bus specific directories anyway, basically the only bus directory that really has device driver in it is USB at this point. It makes some sense to have a bus-specific low-level user space interface driver like sg or uio in the bus directory, but everything else should really belong into some other subsystem.

Quoted 4 lines

Err, what about I2C and SPI? Aren't drivers/i2c/busses and drivers/spi full of "device drivers"? Or are these what you call "bus-specific drivers"? Maybe we need to define all the terms before the discussion continues further.

drivers/i2c/busses and drivers/spi are full of what I would call "bus drivers" or "host drivers". They bind to a device from another bus (platform, pci, ...) and export devices of their own type (i2c, spi, ...). This is what all bus drivers do.

An i2c or spi device driver would in turn bind to that device and provide a functionality not specific to that bus (e.g. hwmon, input, leds, rtc or media).

Quoted 11 lines
Quoted 6 lines

(...)
This is about to get worse as we introduce new subsystems (e.g. iommu, irq, clocksource, eeprom, nvram, ...) into which we are moving code from arch/arm, drivers/char and drivers/misc. Having buses and drivers in a separate hierarchy would make the drivers directory and the respective menuconfig list more clearly structured IMHO.

This gets interesting. Would you suggest for example that i2c-core.c goes to bus/i2c, and drivers/i2c/busses becomes drivers/i2c? And that CONFIG_I2C is somewhere in menuconfig, and the hardware driver selection for drivers/i2c is in a totally different place?

No, all of drivers/i2c would go into bus/i2c or drivers/bus/i2c, there is no point splitting that. The part that would no go there is the various drivers that are already not under drivers/i2c but are for devices connected to an i2c bus.

The confusion is probably that in case of drivers/scsi and drivers/usb, both bus and device drivers are in the same subdirectories. If we move drivers/usb to bus/usb, I would probably recommend to split drivers/usb/{serial,storage,atm,misc} out of it and move it to drivers/{tty/usb-serial,block/usb,net/usb/atm,misc/usb} though, to make it look more like PCI or i2c that already have a clean split.

Quoted 3 lines

While I am surprised, I am not necessarily objecting. But it seems that you should better define what your actual plan is, before asking us if we agree with it.

My original plan was to think this through a bit more, but Grant posted the big spi reorganization, so I jumped in on that because it wouldn't be nice to have to move all those drivers again.

Arnd

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Discover what all the cheering's about. Get your free trial download today.
http://p.sf.net/sfu/quest-dev2dev2

#20 lore raw
Quoted 41 lines · On Jun 06 Arnd Bergmann wrote:
Quoted 9 lines · Jean Delvare
Quoted 7 lines · Arnd Bergmann

A top-level /bus would work for me, and I guess would also address Russell's concern. Regarding bus-specific drivers, we're gradually moving those out of the bus specific directories anyway, basically the only bus directory that really has device driver in it is USB at this point. It makes some sense to have a bus-specific low-level user space interface driver like sg or uio in the bus directory, but everything else should really belong into some other subsystem.

Quoted 4 lines

Err, what about I2C and SPI? Aren't drivers/i2c/busses and drivers/spi full of "device drivers"? Or are these what you call "bus-specific drivers"? Maybe we need to define all the terms before the discussion continues further.

drivers/i2c/busses and drivers/spi are full of what I would call "bus drivers" or "host drivers". They bind to a device from another bus (platform, pci, ...) and export devices of their own type (i2c, spi, ...). This is what all bus drivers do.

An i2c or spi device driver would in turn bind to that device and provide a functionality not specific to that bus (e.g. hwmon, input, leds, rtc or media).

Quoted 11 lines
Quoted 6 lines

(...)
This is about to get worse as we introduce new subsystems (e.g. iommu, irq, clocksource, eeprom, nvram, ...) into which we are moving code from arch/arm, drivers/char and drivers/misc. Having buses and drivers in a separate hierarchy would make the drivers directory and the respective menuconfig list more clearly structured IMHO.

This gets interesting. Would you suggest for example that i2c-core.c goes to bus/i2c, and drivers/i2c/busses becomes drivers/i2c? And that CONFIG_I2C is somewhere in menuconfig, and the hardware driver selection for drivers/i2c is in a totally different place?

No, all of drivers/i2c would go into bus/i2c or drivers/bus/i2c, there is no point splitting that. The part that would no go there is the various drivers that are already not under drivers/i2c but are for devices connected to an i2c bus.

Quoted 6 lines

The confusion is probably that in case of drivers/scsi and drivers/usb, both bus and device drivers are in the same subdirectories. If we move drivers/usb to bus/usb, I would probably recommend to split drivers/usb/{serial,storage,atm,misc} out of it and move it to drivers/{tty/usb-serial,block/usb,net/usb/atm,misc/usb} though, to make it look more like PCI or i2c that already have a clean split.

On drivers/firewire/:

FireWire drivers are currently spread over drivers/firewire (three link-layer controller drivers + the IEEE 1394 core + two IEEE 1394 application layer drivers), drivers/media/dvb/firewire/ (one 1394 application layer driver), sound/firewire/ (two 1394 application layer drivers, more are planned to be added there).

Quoted 1 line

From the Linux driver model POV,

1. the IEEE 1394 core driver implements the firewire bus,
2. the link-layer controller drivers implement pci bus based devices,
3. the IEEE 1394 application layer drivers implement firewire bus based devices. The two of them that are located in drivers/firewire/ expose a SCSI LLD (a transport in SCSI Architecture Model terms, but a host rather than a transport in Linux implementation terms) and a networking interface driver.

Number 2 is something one would expect to find in a hypothetical drivers/bus/ directory. But where do the others belong?

Would type 1 drivers be kept in drivers/bus/firewire/? I understand your above response to Jean that this is what you have in mind.

firewire-sbp2 could be moved into drivers/scsi/, and firewire-net could be moved into drivers/net/. But what about maintenance? They could still be maintained via linux1394-2.6.git because this worked so far, but then the directory structure might irritate people who don't use scripts/get_maintainer.pl all the time. Well, I could actually picture firewire-net to be maintained via the net development tree, but I do wonder how well firewire-sbp2 maintenance through the scsi tree would work.

PS,
these are the same questions like with USB, only on a smaller scale. (The usb-storage driver is maintained through the usb tree as well, not the scsi tree. drivers/net/usb/ has got T: git .../gregkh/usb-2.6.git assigned in MAINTAINERS but most of the commits there are actually done by DaveM.)

PPS,
besides association of source files with development trees, there is also the association with developer mailing lists and user mailing lists and web resources, e.g. wiki. How logical the directory layout is in this sense could be approximately measured by means of the count of necessary entries in MAINTAINERS.

Signature · 3 lines
Stefan Richter
-=====-==-== -==- --==-
http://arcgraph.de/sr/
#21 lore raw
Quoted 19 lines · Stefan Richter
Quoted 1 line · On Jun 06 Arnd Bergmann wrote:

On Monday 06 June 2011, Jean Delvare wrote:

On drivers/firewire/:

FireWire drivers are currently spread over drivers/firewire (three link-layer controller drivers + the IEEE 1394 core + two IEEE 1394 application layer drivers), drivers/media/dvb/firewire/ (one 1394 application layer driver), sound/firewire/ (two 1394 application layer drivers, more are planned to be added there).

From the Linux driver model POV,
1. the IEEE 1394 core driver implements the firewire bus,
2. the link-layer controller drivers implement pci bus based devices,
3. the IEEE 1394 application layer drivers implement firewire bus based devices. The two of them that are located in drivers/firewire/ expose a SCSI LLD (a transport in SCSI Architecture Model terms, but a host rather than a transport in Linux implementation terms) and a networking interface driver.

Quoted 5 lines

Number 2 is something one would expect to find in a hypothetical drivers/bus/ directory. But where do the others belong?

Would type 1 drivers be kept in drivers/bus/firewire/? I understand your above response to Jean that this is what you have in mind.

Correct.

Quoted 7 lines

firewire-sbp2 could be moved into drivers/scsi/, and firewire-net could be moved into drivers/net/. But what about maintenance? They could still be maintained via linux1394-2.6.git because this worked so far, but then the directory structure might irritate people who don't use scripts/get_maintainer.pl all the time. Well, I could actually picture firewire-net to be maintained via the net development tree, but I do wonder how well firewire-sbp2 maintenance through the scsi tree would work.

I guess the real question is whether firewire should be considered a bus like USB or a device class like SCSI, and it's abit of a grey area (SCSI is too). If you declare it to be a bus, I'd suggest moving the sbp2 and network drivers to drivers/scsi and drivers/net. If you like to think of firewire as a closed subsystem instead, it's probably better to leave all of it in drivers/firewire.

Quoted 6 lines

PS,
these are the same questions like with USB, only on a smaller scale. (The usb-storage driver is maintained through the usb tree as well, not the scsi tree. drivers/net/usb/ has got T: git .../gregkh/usb-2.6.git assigned in MAINTAINERS but most of the commits there are actually done by DaveM.)

The difference that I see with usb-storage is that this one is really a set of different drivers for all sorts of devices, while the firewire sbp2 driver feels more like a single driver that includes a few special cases. Also, USB is generally perceived as a generic interconnect, while firewire is seen primarily as a way to attach disk drives.

The differences are of course gradual.

Arnd

#22 lore raw
In reply to Arnd Bergmann
Quoted 4 lines · Arnd Bergmann

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

Quoted 8 lines

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

Specifically, I'd like to do these moves:

drivers/{ => bus}/zorro

(if we go that way in general)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

_______________________________________________
Linux PCMCIA reimplementation list
http://lists.infradead.org/mailman/listinfo/linux-pcmcia

#23 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann
Quoted 10 lines · Grant Likely

 rename drivers/spi/{omap2_mcspi.c => spi_omap2_mcspi.c} (100%) rename drivers/spi/{omap_spi_100k.c => spi_omap_100k.c} (100%) rename drivers/spi/{omap_uwire.c => spi_omap_uwire.c} (100%) rename drivers/spi/{orion_spi.c => spi_orion.c} (100%) rename drivers/spi/{amba-pl022.c => spi_pl022.c} (100%) rename drivers/spi/{pxa2xx_spi.c => spi_pxa2xx.c} (100%) rename drivers/spi/{pxa2xx_spi_pci.c => spi_pxa2xx_pci.c} (100%) rename drivers/spi/{ti-ssp-spi.c => spi_ti_ssp.c} (100%) rename drivers/spi/{tle62x0.c => spi_tle62x0.c} (100%) rename drivers/spi/{xilinx_spi.c => spi_xilinx.c} (100%)

Quoted 8 lines

I recently looked at the directory structure in drivers/ and found a lot of bus drivers with very few files, plus a few bus drivers with a lot of files in them besides directories for non-bus specific subsystems.

I think it would be good to move them into a deeper directory drivers/bus/ if we have support from the maintainers, and it's probably better if we only have to move the files once to reduce the amount of churn on the MAINTAINERS file and any out of tree patches.

I had this thought too when I was looking at reorganizing the gpio and spi directories, but ultimately I came to the conclusion that it didn't really make much sense to move them. Bus drivers are just another kind of device driver. In general, the organization of having a directory (like spi or i2c) containing both the common bus infrastructure and a set of drivers using it, and this isn't even unlike what we do for non-bus drivers. I don't see much need to move these.

However, there are a number of bus types that have infrastructure, but no actual drivers associated with them, like mca, amba and clk. It might make sense to move those bus types into drivers/base alongside the platform_bus_type implementation.

g.

#24 lore raw
Quoted 4 lines · Grant Likely

However, there are a number of bus types that have infrastructure, but no actual drivers associated with them, like mca, amba and clk. It might make sense to move those bus types into drivers/base alongside the platform_bus_type implementation.

More or less agreed - I'm not sure we should think about clk just yet because we don't know what that'll end up looking like yet...