[PATCH v2 5/7] alpha: marvel: register a platform device for the environmental sensors

From: Matt Turner

Date: Mon Nov 16 2026 - 21:59:32 EST


Register a "marvel_env" platform device on Marvel systems booted from
SRM, for the hwmon driver to bind to.

Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
---
arch/alpha/kernel/core_marvel.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/alpha/kernel/core_marvel.c b/arch/alpha/kernel/core_marvel.c
index 7525f3ed6b62..169a1df6adb2 100644
--- a/arch/alpha/kernel/core_marvel.c
+++ b/arch/alpha/kernel/core_marvel.c
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/memblock.h>
#include <linux/workqueue.h>
+#include <linux/platform_device.h>

#include <asm/ptrace.h>
#include <asm/smp.h>
@@ -1139,3 +1140,13 @@ long marvel_cfgtree_partial_update(unsigned long offset)
return status;
}
EXPORT_SYMBOL_GPL(marvel_cfgtree_partial_update);
+
+static int __init marvel_env_init(void)
+{
+ if (alpha_mv.init_arch != marvel_init_arch || !alpha_using_srm)
+ return 0;
+
+ return PTR_ERR_OR_ZERO(platform_device_register_simple("marvel_env",
+ -1, NULL, 0));
+}
+device_initcall(marvel_env_init);

--
2.56.1