Skip to content

Commit 3d1ffbe

Browse files
committed
platform/x86: intel: Add 'intel' prefix to the modules automatically
JIRA: https://issues.redhat.com/browse/RHEL-79669 commit df7f9ac Author: Andy Shevchenko <[email protected]> Date: Wed Oct 16 13:59:51 2024 +0300 platform/x86: intel: Add 'intel' prefix to the modules automatically Rework Makefile to add 'intel' prefix to the modules automatically. This removes a lot of boilerplate code in it and also makes robust against mistypos in the prefix. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: David Arcari <[email protected]>
1 parent 7031c3e commit 3d1ffbe

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

drivers/platform/x86/intel/Makefile

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,35 @@ obj-$(CONFIG_INTEL_WMI) += wmi/
1616
obj-$(CONFIG_INTEL_UNCORE_FREQ_CONTROL) += uncore-frequency/
1717

1818
# Intel input drivers
19-
intel-hid-y := hid.o
20-
obj-$(CONFIG_INTEL_HID_EVENT) += intel-hid.o
21-
intel-vbtn-y := vbtn.o
22-
obj-$(CONFIG_INTEL_VBTN) += intel-vbtn.o
19+
intel-target-$(CONFIG_INTEL_HID_EVENT) += hid.o
20+
intel-target-$(CONFIG_INTEL_VBTN) += vbtn.o
2321

2422
# Intel miscellaneous drivers
25-
obj-$(CONFIG_INTEL_ISHTP_ECLITE) += ishtp_eclite.o
26-
intel_int0002_vgpio-y := int0002_vgpio.o
27-
obj-$(CONFIG_INTEL_INT0002_VGPIO) += intel_int0002_vgpio.o
28-
intel_oaktrail-y := oaktrail.o
29-
obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
30-
intel_sdsi-y := sdsi.o
31-
obj-$(CONFIG_INTEL_SDSI) += intel_sdsi.o
32-
intel_vsec-y := vsec.o
33-
obj-$(CONFIG_INTEL_VSEC) += intel_vsec.o
23+
intel-target-$(CONFIG_INTEL_INT0002_VGPIO) += int0002_vgpio.o
24+
intel-target-$(CONFIG_INTEL_ISHTP_ECLITE) += ishtp_eclite.o
25+
intel-target-$(CONFIG_INTEL_OAKTRAIL) += oaktrail.o
26+
intel-target-$(CONFIG_INTEL_SDSI) += sdsi.o
27+
intel-target-$(CONFIG_INTEL_VSEC) += vsec.o
3428

3529
# Intel PMIC / PMC / P-Unit drivers
3630
obj-$(CONFIG_INTEL_CHT_INT33FE) += int33fe/
3731

3832
# TPMI drivers
39-
intel_vsec_tpmi-y := tpmi.o
40-
obj-$(CONFIG_INTEL_TPMI) += intel_vsec_tpmi.o
41-
obj-$(CONFIG_INTEL_PLR_TPMI) += intel_plr_tpmi.o
42-
43-
intel_tpmi_power_domains-y := tpmi_power_domains.o
44-
obj-$(CONFIG_INTEL_TPMI_POWER_DOMAINS) += intel_tpmi_power_domains.o
33+
intel-target-$(CONFIG_INTEL_PLR_TPMI) += plr_tpmi.o
34+
intel-target-$(CONFIG_INTEL_TPMI_POWER_DOMAINS) += tpmi_power_domains.o
35+
intel-target-$(CONFIG_INTEL_TPMI) += vsec_tpmi.o
4536

4637
# Intel Uncore drivers
47-
intel-rst-y := rst.o
48-
obj-$(CONFIG_INTEL_RST) += intel-rst.o
49-
intel-smartconnect-y := smartconnect.o
50-
obj-$(CONFIG_INTEL_SMARTCONNECT) += intel-smartconnect.o
51-
intel_turbo_max_3-y := turbo_max_3.o
52-
obj-$(CONFIG_INTEL_TURBO_MAX_3) += intel_turbo_max_3.o
53-
38+
intel-target-$(CONFIG_INTEL_RST) += rst.o
39+
intel-target-$(CONFIG_INTEL_SMARTCONNECT) += smartconnect.o
40+
intel-target-$(CONFIG_INTEL_TURBO_MAX_3) += turbo_max_3.o
41+
42+
# Add 'intel' prefix to each module listed in intel-target-*
43+
define INTEL_OBJ_TARGET
44+
intel-$(1)-y := $(1).o
45+
obj-$(2) += intel-$(1).o
46+
endef
47+
48+
$(foreach target, $(basename $(intel-target-y)), $(eval $(call INTEL_OBJ_TARGET,$(target),y)))
49+
$(foreach target, $(basename $(intel-target-m)), $(eval $(call INTEL_OBJ_TARGET,$(target),m)))
5450

drivers/platform/x86/intel/tpmi.c renamed to drivers/platform/x86/intel/vsec_tpmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* intel-tpmi : Driver to enumerate TPMI features and create devices
3+
* Driver to enumerate TPMI features and create devices
44
*
55
* Copyright (c) 2023, Intel Corporation.
66
* All Rights Reserved.

0 commit comments

Comments
 (0)