[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] hw/arm/aspeed: allow missing spi_model
From: |
Patrick Williams |
Subject: |
[PATCH 1/2] hw/arm/aspeed: allow missing spi_model |
Date: |
Fri, 4 Mar 2022 18:06:55 -0600 |
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
- [PATCH 1/2] hw/arm/aspeed: allow missing spi_model,
Patrick Williams <=
Re: [PATCH 1/2] hw/arm/aspeed: allow missing spi_model, Cédric Le Goater, 2022/03/05