Skip to content

Commit 8bee6f0

Browse files
committed
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 <[email protected]> Reviewed-by: Eric Auger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent 8cc7518 commit 8bee6f0

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

drivers/vfio/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ vfio-$(CONFIG_VFIO_VIRQFD) += virqfd.o
1111
obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
1212
obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
1313
obj-$(CONFIG_VFIO_PCI_CORE) += pci/
14-
obj-$(CONFIG_VFIO_PLATFORM) += platform/
14+
obj-$(CONFIG_VFIO_PLATFORM_BASE) += platform/
1515
obj-$(CONFIG_VFIO_MDEV) += mdev/
1616
obj-$(CONFIG_VFIO_FSL_MC) += fsl-mc/

drivers/vfio/platform/Kconfig

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
11
# 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"
43
depends on ARM || ARM64 || COMPILE_TEST
4+
5+
config VFIO_PLATFORM_BASE
6+
tristate
57
select VFIO_VIRQFD
8+
9+
config VFIO_PLATFORM
10+
tristate "Generic VFIO support for any platform device"
11+
select VFIO_PLATFORM_BASE
612
help
713
Support for platform devices with VFIO. This is required to make
814
use of platform devices present on the system using the VFIO
915
framework.
1016

1117
If you don't know what to do here, say N.
1218

13-
if VFIO_PLATFORM
1419
config VFIO_AMBA
1520
tristate "VFIO support for AMBA devices"
1621
depends on ARM_AMBA || COMPILE_TEST
22+
select VFIO_PLATFORM_BASE
1723
help
1824
Support for ARM AMBA devices with VFIO. This is required to make
1925
use of ARM AMBA devices present on the system using the VFIO
2026
framework.
2127

2228
If you don't know what to do here, say N.
2329

30+
menu "VFIO platform reset drivers"
31+
depends on VFIO_PLATFORM_BASE
32+
2433
source "drivers/vfio/platform/reset/Kconfig"
25-
endif
34+
endmenu
35+
endmenu

drivers/vfio/platform/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# SPDX-License-Identifier: GPL-2.0
22
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/
45

6+
vfio-platform-y := vfio_platform.o
57
obj-$(CONFIG_VFIO_PLATFORM) += vfio-platform.o
6-
obj-$(CONFIG_VFIO_PLATFORM) += vfio-platform-base.o
7-
obj-$(CONFIG_VFIO_PLATFORM) += reset/
88

99
vfio-amba-y := vfio_amba.o
10-
1110
obj-$(CONFIG_VFIO_AMBA) += vfio-amba.o
12-
obj-$(CONFIG_VFIO_AMBA) += vfio-platform-base.o
13-
obj-$(CONFIG_VFIO_AMBA) += reset/

drivers/vfio/platform/reset/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2+
if VFIO_PLATFORM
23
config VFIO_PLATFORM_CALXEDAXGMAC_RESET
34
tristate "VFIO support for calxeda xgmac reset"
45
help
@@ -21,3 +22,4 @@ config VFIO_PLATFORM_BCMFLEXRM_RESET
2122
Enables the VFIO platform driver to handle reset for Broadcom FlexRM
2223

2324
If you don't know what to do here, say N.
25+
endif

0 commit comments

Comments
 (0)