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

From: Matt Turner

Date: Sat Nov 14 2026 - 12:40:49 EST


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

Assisted-by: Claude:claude-opus-5-5
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 bd918028b410..d2e1e45cdf1e 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>
@@ -1142,3 +1143,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