This patch series splits the ACPI and platform device probing in hsmp driver based on suggestion by Ilpo Jarvinen https://lore.kernel.org/platform-driver-x86/20240607133405.1211929-1-suma.hegde@xxxxxxx/T/#t This change will help: - Keep the probes clean of the if else ladder - use dev_groups in platform driver structure, instead of using devm_device_add_group() - use is_visible() to enable only the necessary sysfs entries. Patch1-5 : Add smaller functions in preparation for the split no logical change, code is re-structured to ease the driver split. Patch6 : Split ACPI and platform device based drivers as 2 mutually exclusive drivers, only one of them can be enabled. Make Kconfig and Makefile changes to support this. Patch7 : Add namespace to exported symbol hsmp_send_messag() Patch8-9 : Remove dynamic creation and use dev_groups instead. Patch 10 : Fix smatch error Suma Hegde (10): platform/x86/amd/hsmp: Create hsmp/ directory platform/x86/amd/hsmp: Create wrapper function init_acpi() platform/x86/amd/hsmp: Move strcuture and macros to header file platform/x86/amd/hsmp: Move platform device specific code to plat.c platform/x86/amd/hsmp: Move ACPI code to acpi.c platform/x86/amd/hsmp: Create mutually exclusive ACPI and plat drivers platform/x86/amd/hsmp: Use name space while exporting module symbols platform/x86/amd/hsmp: Move read and is_visible to respective files platform/x86/amd/hsmp: Use dev_groups in the driver structure platform/x86/amd/hsmp: Fix potential spectre issue MAINTAINERS | 2 +- arch/x86/include/asm/amd_hsmp.h | 2 +- drivers/platform/x86/amd/Kconfig | 14 +- drivers/platform/x86/amd/Makefile | 3 +- drivers/platform/x86/amd/hsmp.c | 988 ------------------------- drivers/platform/x86/amd/hsmp/Kconfig | 40 + drivers/platform/x86/amd/hsmp/Makefile | 14 + drivers/platform/x86/amd/hsmp/acpi.c | 410 ++++++++++ drivers/platform/x86/amd/hsmp/hsmp.c | 323 ++++++++ drivers/platform/x86/amd/hsmp/hsmp.h | 61 ++ drivers/platform/x86/amd/hsmp/plat.c | 368 +++++++++ 11 files changed, 1220 insertions(+), 1005 deletions(-) delete mode 100644 drivers/platform/x86/amd/hsmp.c create mode 100644 drivers/platform/x86/amd/hsmp/Kconfig create mode 100644 drivers/platform/x86/amd/hsmp/Makefile create mode 100644 drivers/platform/x86/amd/hsmp/acpi.c create mode 100644 drivers/platform/x86/amd/hsmp/hsmp.c create mode 100644 drivers/platform/x86/amd/hsmp/hsmp.h create mode 100644 drivers/platform/x86/amd/hsmp/plat.c -- 2.25.1