mirror of
https://github.com/qemu/qemu.git
synced 2024-12-11 20:53:51 +08:00
hw/arm/fsl-imx*: Don't create "null" chardevs for serial devices
Following commit 12051d82f0
, 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
This commit is contained in:
parent
47c4f85a0c
commit
c221287f8f
@ -118,17 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
|
||||
};
|
||||
|
||||
if (i < MAX_SERIAL_PORTS) {
|
||||
Chardev *chr;
|
||||
|
||||
chr = serial_hds[i];
|
||||
|
||||
if (!chr) {
|
||||
char label[20];
|
||||
snprintf(label, sizeof(label), "imx31.uart%d", i);
|
||||
chr = qemu_chr_new(label, "null");
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -107,17 +107,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
|
||||
};
|
||||
|
||||
if (i < MAX_SERIAL_PORTS) {
|
||||
Chardev *chr;
|
||||
|
||||
chr = serial_hds[i];
|
||||
|
||||
if (!chr) {
|
||||
char label[20];
|
||||
snprintf(label, sizeof(label), "imx31.uart%d", i);
|
||||
chr = qemu_chr_new(label, "null");
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user