Skip to contentSkip to conversation

niagara: check if a serial port is available

PATCH Superseded Artyom Tarasenko 2 participants 2 messages Jan 23, 2017 – Jan 24, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 niagara: check if a serial port is available

---
 hw/sparc64/niagara.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
hw/sparc64/niagara.c +4 -3
index e945b5a..a14724f 100644
@@ -154,9 +154,10 @@ static void niagara_init(MachineState *machine)
             exit(1);
         }
     }
-    serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
-                   serial_hds[0], DEVICE_BIG_ENDIAN);
-
+    if (serial_hds[0]) {
+        serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
+                       serial_hds[0], DEVICE_BIG_ENDIAN);
+    }
     empty_slot_init(NIAGARA_IOBBASE, NIAGARA_IOBSIZE);
     sun4v_rtc_init(NIAGARA_RTC_BASE);
 }
Signature · 1 line
2.7.2
Reviewed-by on v1 2/2
#1 lore raw

Your series lacks threading: the patches don't carry In-Reply-To and References headers. The easiest way to fix that is sending them with git-send-email --thread. You should be able to omit --thread; it's the default unless configured otherwise.

Quoted 14 lines · Artyom Tarasenko
---
 hw/sparc64/niagara.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
hw/sparc64/niagara.c +0 -0
index e945b5a..a14724f 100644
@@ -154,9 +154,10 @@ static void niagara_init(MachineState *machine)
             exit(1);
         }
     }

hw/sparc64/niagara.c static void niagara_init(MachineState *machine) · line 163

Quoted 10 lines
hw/sparc64/niagara.c +4 -3
-    serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
-                   serial_hds[0], DEVICE_BIG_ENDIAN);
-
+    if (serial_hds[0]) {
+        serial_mm_init(sysmem, NIAGARA_UART_BASE, 0, NULL, 115200,
+                       serial_hds[0], DEVICE_BIG_ENDIAN);
+    }
     empty_slot_init(NIAGARA_IOBBASE, NIAGARA_IOBSIZE);
     sun4v_rtc_init(NIAGARA_RTC_BASE);
 }