diff options
author | Peter Maydell | 2018-04-20 16:52:38 +0200 |
---|---|---|
committer | Peter Maydell | 2018-04-26 14:57:00 +0200 |
commit | c221287f8ff4e46fffad11bb2a6bc99442e845be (patch) | |
tree | e1767e0f8ba73bb53c822e2d953569aba24e1ff9 /hw/arm/fsl-imx6.c | |
parent | hw/char/serial: Allow disconnected chardevs (diff) | |
download | qemu-c221287f8ff4e46fffad11bb2a6bc99442e845be.tar.gz qemu-c221287f8ff4e46fffad11bb2a6bc99442e845be.tar.xz qemu-c221287f8ff4e46fffad11bb2a6bc99442e845be.zip |
hw/arm/fsl-imx*: Don't create "null" chardevs for serial devices
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[].
(fsl-imx7.c was already written this way.)
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20180420145249.32435-3-peter.maydell@linaro.org
Diffstat (limited to 'hw/arm/fsl-imx6.c')
-rw-r--r-- | hw/arm/fsl-imx6.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 9dfbc9a8c4..ea14de33c6 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -189,18 +189,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) }; if (i < MAX_SERIAL_PORTS) { - Chardev *chr; - - chr = serial_hds[i]; - - if (!chr) { - char *label = g_strdup_printf("imx6.uart%d", i + 1); - chr = qemu_chr_new(label, "null"); - g_free(label); - serial_hds[i] = chr; - } - - qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", chr); + qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hds[i]); } object_property_set_bool(OBJECT(&s->uart[i]), true, "realized", &err); |