[PATCH v3 1/6] PCI: rockchip: Create individual folder for rockchip drivers
Bjorn Helgaas
helgaas at kernel.org
Tue Mar 20 10:46:33 PDT 2018
On Tue, Mar 06, 2018 at 10:43:22AM +0800, Shawn Lin wrote:
> In preparation for introducing End-Point driver for Rockchip
> PCIe controller, we create a new folder to follow the convention
> of dwc and cadence. Then we rename the host driver from pcie-rockchip.c
> to pcie-rockchip-host.c, and only leave some common functions in
> pcie-rockchip.c in order to be reused for both of host and EP drivers.
>
> Signed-off-by: Shawn Lin <shawn.lin at rock-chips.com>
> Tested-by: Jeffy Chen <jeffy.chen at rock-chips.com>
> ...
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index 34b56a8..b85ad40 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -141,4 +141,5 @@ source "drivers/pci/cadence/Kconfig"
> source "drivers/pci/dwc/Kconfig"
> source "drivers/pci/host/Kconfig"
> source "drivers/pci/endpoint/Kconfig"
> +source "drivers/pci/rockchip/Kconfig"
> source "drivers/pci/switch/Kconfig"
Why is this out of order? This seems exactly analogous to
drivers/pci/cadence and dwc, so they should be next to each other.
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 9419709..8434afb 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -55,6 +55,8 @@ obj-y += switch/
>
> obj-$(CONFIG_PCI_ENDPOINT) += endpoint/
>
> +obj-$(CONFIG_PCIE_ROCKCHIP) += rockchip/
> +
> # Endpoint library must be initialized before its users
> obj-$(CONFIG_PCIE_CADENCE) += cadence/
> # pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW
Similarly here.
I admit to still being a little dubious about the idea of a bunch of
vendor-specific directories, each containing a completely trivial
Makefile, a mostly-trivial Kconfig, a header file, a shared .c file, a
host .c file, and an endpoint .c file.
One alternative would be to keep the single pcie-rockchip.c file with
an #ifdef CONFIG_PCIE_ROCKCHIP_HOST section and an #ifdef
CONFIG_PCIE_ROCKCHIP_EP section.
Bjorn
More information about the Linux-rockchip
mailing list