Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vfio/platform: Cleanup Kconfig

Like vfio-pci, there's also a base module here where vfio-amba depends on
vfio-platform, when really it only needs vfio-platform-base. Create a
sub-menu for platform drivers and a nested menu for reset drivers. Cleanup
Makefile to make use of new CONFIG_VFIO_PLATFORM_BASE for building the
shared modules and traversing reset modules.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20230614193948.477036-3-alex.williamson@redhat.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

+20 -11
+1 -1
drivers/vfio/Makefile
··· 11 11 obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o 12 12 obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o 13 13 obj-$(CONFIG_VFIO_PCI_CORE) += pci/ 14 - obj-$(CONFIG_VFIO_PLATFORM) += platform/ 14 + obj-$(CONFIG_VFIO_PLATFORM_BASE) += platform/ 15 15 obj-$(CONFIG_VFIO_MDEV) += mdev/ 16 16 obj-$(CONFIG_VFIO_FSL_MC) += fsl-mc/
+14 -4
drivers/vfio/platform/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - config VFIO_PLATFORM 3 - tristate "VFIO support for platform devices" 2 + menu "VFIO support for platform devices" 4 3 depends on ARM || ARM64 || COMPILE_TEST 4 + 5 + config VFIO_PLATFORM_BASE 6 + tristate 5 7 select VFIO_VIRQFD 8 + 9 + config VFIO_PLATFORM 10 + tristate "Generic VFIO support for any platform device" 11 + select VFIO_PLATFORM_BASE 6 12 help 7 13 Support for platform devices with VFIO. This is required to make 8 14 use of platform devices present on the system using the VFIO ··· 16 10 17 11 If you don't know what to do here, say N. 18 12 19 - if VFIO_PLATFORM 20 13 config VFIO_AMBA 21 14 tristate "VFIO support for AMBA devices" 22 15 depends on ARM_AMBA || COMPILE_TEST 16 + select VFIO_PLATFORM_BASE 23 17 help 24 18 Support for ARM AMBA devices with VFIO. This is required to make 25 19 use of ARM AMBA devices present on the system using the VFIO ··· 27 21 28 22 If you don't know what to do here, say N. 29 23 24 + menu "VFIO platform reset drivers" 25 + depends on VFIO_PLATFORM_BASE 26 + 30 27 source "drivers/vfio/platform/reset/Kconfig" 31 - endif 28 + endmenu 29 + endmenu
+3 -6
drivers/vfio/platform/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 vfio-platform-base-y := vfio_platform_common.o vfio_platform_irq.o 3 - vfio-platform-y := vfio_platform.o 3 + obj-$(CONFIG_VFIO_PLATFORM_BASE) += vfio-platform-base.o 4 + obj-$(CONFIG_VFIO_PLATFORM_BASE) += reset/ 4 5 6 + vfio-platform-y := vfio_platform.o 5 7 obj-$(CONFIG_VFIO_PLATFORM) += vfio-platform.o 6 - obj-$(CONFIG_VFIO_PLATFORM) += vfio-platform-base.o 7 - obj-$(CONFIG_VFIO_PLATFORM) += reset/ 8 8 9 9 vfio-amba-y := vfio_amba.o 10 - 11 10 obj-$(CONFIG_VFIO_AMBA) += vfio-amba.o 12 - obj-$(CONFIG_VFIO_AMBA) += vfio-platform-base.o 13 - obj-$(CONFIG_VFIO_AMBA) += reset/
+2
drivers/vfio/platform/reset/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + if VFIO_PLATFORM 2 3 config VFIO_PLATFORM_CALXEDAXGMAC_RESET 3 4 tristate "VFIO support for calxeda xgmac reset" 4 5 help ··· 22 21 Enables the VFIO platform driver to handle reset for Broadcom FlexRM 23 22 24 23 If you don't know what to do here, say N. 24 + endif