diff mbox series

[05/13] hw/xtensa/xtfpga.c: Don't create "null" chardevs for serial devices

Message ID 20180420145249.32435-6-peter.maydell@linaro.org
State Accepted
Commit b82fcd30325815254eea7197337b3e15e0a46938
Headers show
Series Drop compile time limit on number of serial ports | expand

Commit Message

Peter Maydell April 20, 2018, 2:52 p.m. UTC
Following commit 12051d82f004024, UART devices should handle
being passed a NULL pointer chardev, so we don't need to
create "null" backends in board code. Remove the code that
does this and updates serial_hds[].

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
 hw/xtensa/xtfpga.c | 4 ----
 1 file changed, 4 deletions(-)

-- 
2.17.0

Comments

Philippe Mathieu-Daudé April 21, 2018, 10:26 p.m. UTC | #1
On 04/20/2018 11:52 AM, Peter Maydell wrote:
> Following commit 12051d82f004024, UART devices should handle

> being passed a NULL pointer chardev, so we don't need to

> create "null" backends in board code. Remove the code that

> does this and updates serial_hds[].

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


> ---

>  hw/xtensa/xtfpga.c | 4 ----

>  1 file changed, 4 deletions(-)

> 

> diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c

> index 70686a2eb1..9db99e1f7e 100644

> --- a/hw/xtensa/xtfpga.c

> +++ b/hw/xtensa/xtfpga.c

> @@ -278,10 +278,6 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)

>                  xtensa_get_extint(env, 1), nd_table);

>      }

>  

> -    if (!serial_hds[0]) {

> -        serial_hds[0] = qemu_chr_new("serial0", "null");

> -    }

> -

>      serial_mm_init(system_io, 0x0d050020, 2, xtensa_get_extint(env, 0),

>              115200, serial_hds[0], DEVICE_NATIVE_ENDIAN);

>  

>
Thomas Huth April 25, 2018, 2:39 p.m. UTC | #2
On 20.04.2018 16:52, Peter Maydell wrote:
> Following commit 12051d82f004024, UART devices should handle

> being passed a NULL pointer chardev, so we don't need to

> create "null" backends in board code. Remove the code that

> does this and updates serial_hds[].

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---

>  hw/xtensa/xtfpga.c | 4 ----

>  1 file changed, 4 deletions(-)

> 

> diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c

> index 70686a2eb1..9db99e1f7e 100644

> --- a/hw/xtensa/xtfpga.c

> +++ b/hw/xtensa/xtfpga.c

> @@ -278,10 +278,6 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)

>                  xtensa_get_extint(env, 1), nd_table);

>      }

>  

> -    if (!serial_hds[0]) {

> -        serial_hds[0] = qemu_chr_new("serial0", "null");

> -    }

> -

>      serial_mm_init(system_io, 0x0d050020, 2, xtensa_get_extint(env, 0),

>              115200, serial_hds[0], DEVICE_NATIVE_ENDIAN);


Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 70686a2eb1..9db99e1f7e 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -278,10 +278,6 @@  static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
                 xtensa_get_extint(env, 1), nd_table);
     }
 
-    if (!serial_hds[0]) {
-        serial_hds[0] = qemu_chr_new("serial0", "null");
-    }
-
     serial_mm_init(system_io, 0x0d050020, 2, xtensa_get_extint(env, 0),
             115200, serial_hds[0], DEVICE_NATIVE_ENDIAN);