All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] hw/arm/aspeed: allow missing spi_model
@ 2022-03-05  0:06 Patrick Williams
  2022-03-05  0:06 ` [PATCH 2/2] hw/arm/aspeed: add Bletchley machine type Patrick Williams
  2022-03-05  7:53 ` [PATCH 1/2] hw/arm/aspeed: allow missing spi_model Cédric Le Goater
  0 siblings, 2 replies; 8+ messages in thread
From: Patrick Williams @ 2022-03-05  0:06 UTC (permalink / raw)
  Cc: Peter Maydell, Andrew Jeffery, open list:All patches CC here,
	Patrick Williams, open list:ASPEED BMCs, Joel Stanley,
	Cédric Le Goater

Generally all BMCs will use the fmc_model to hold their own flash
and most will have a spi_model to hold the managed system's flash,
but not all systems do.  Add a simple NULL check to allow a system
to set the spi_model as NULL to indicate it should not be instantiated.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
 hw/arm/aspeed.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 11558b327b..617a1ecbdc 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -276,7 +276,11 @@ static void aspeed_board_init_flashes(AspeedSMCState *s,
                                       const char *flashtype,
                                       int unit0)
 {
-    int i ;
+    int i;
+
+    if (!flashtype) {
+        return;
+    }
 
     for (i = 0; i < s->num_cs; ++i) {
         DriveInfo *dinfo = drive_get(IF_MTD, 0, unit0 + i);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-08 23:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-05  0:06 [PATCH 1/2] hw/arm/aspeed: allow missing spi_model Patrick Williams
2022-03-05  0:06 ` [PATCH 2/2] hw/arm/aspeed: add Bletchley machine type Patrick Williams
2022-03-05  7:57   ` Cédric Le Goater
2022-03-07 20:59     ` Patrick Williams
2022-03-08  8:14       ` Cédric Le Goater
2022-03-08 17:23         ` Patrick Williams
2022-03-08 23:07           ` Joel Stanley
2022-03-05  7:53 ` [PATCH 1/2] hw/arm/aspeed: allow missing spi_model Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.