[PATCH 1/3] regulator: bcm2835: register only on Raspberry Pi

Ahmad Fatoum a.fatoum at barebox.org
Mon Jan 12 00:56:04 PST 2026


The device was registered whenever the driver was compiled, including in
multi-platform builds. Guard behind raspberrypi,bcm2835-firmware, until
this is turned into a "real" driver one day.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 drivers/regulator/bcm2835.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/bcm2835.c b/drivers/regulator/bcm2835.c
index fa9fc47207b4..9d2803baca24 100644
--- a/drivers/regulator/bcm2835.c
+++ b/drivers/regulator/bcm2835.c
@@ -138,8 +138,10 @@ postcore_platform_driver(regulator_bcm2835_driver);
 
 static int regulator_bcm2835_init(void)
 {
-	add_generic_device("regulator-bcm2835", DEVICE_ID_SINGLE, NULL,
-			   0, 0, 0, NULL);
+	if (of_get_compatible_child(of_get_root_node(),
+				    "raspberrypi,bcm2835-firmware"))
+		add_generic_device("regulator-bcm2835", DEVICE_ID_SINGLE, NULL,
+				   0, 0, 0, NULL);
 
 	return 0;
 }
-- 
2.47.3




More information about the barebox mailing list