]> git.sur5r.net Git - u-boot/blobdiff - drivers/spmi/spmi-sandbox.c
dm: core: Add a way to bind a device by ofnode
[u-boot] / drivers / spmi / spmi-sandbox.c
index 2f0fea07e8012f30171ac9d22a7b243702a8672b..0da419c50529487a57db4e32903adde62abc7992 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Sample SPMI bus driver
  *
  * It emulates bus with single pm8916-like pmic that has only GPIO reigsters.
  *
  * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -15,8 +14,6 @@
 #include <asm/gpio.h>
 #include <asm/io.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define EMUL_GPIO_PID_START 0xC0
 #define EMUL_GPIO_PID_END   0xC3
 
@@ -35,7 +32,8 @@ struct sandbox_emul_fake_regs {
 };
 
 struct sandbox_emul_gpio {
-       struct sandbox_emul_fake_regs r[EMUL_GPIO_REG_END]; /* Fake registers */
+       /* Fake registers - need one more entry as REG_END is valid address. */
+       struct sandbox_emul_fake_regs r[EMUL_GPIO_REG_END + 1];
 };
 
 struct sandbox_spmi_priv {