Commit 0ec7b3e7 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Paolo Bonzini

char: rename CharDriverState Chardev

Pick a uniform chardev type name.
Signed-off-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
parent d5cafc73
......@@ -85,7 +85,7 @@
#define BUF_SIZE 256
typedef struct {
CharDriverState parent;
Chardev parent;
brlapi_handle_t *brlapi;
int brlapi_fd;
......@@ -98,7 +98,7 @@ typedef struct {
uint8_t out_buf_used, out_buf_ptr;
QEMUTimer *cellCount_timer;
} BaumDriverState;
} BaumChardev;
/* Let's assume NABCC by default */
enum way {
......@@ -223,7 +223,7 @@ static const uint8_t nabcc_translation[2][256] = {
};
/* The guest OS has started discussing with us, finish initializing BrlAPI */
static int baum_deferred_init(BaumDriverState *baum)
static int baum_deferred_init(BaumChardev *baum)
{
int tty = BRLAPI_TTY_DEFAULT;
QemuConsole *con;
......@@ -253,9 +253,9 @@ static int baum_deferred_init(BaumDriverState *baum)
}
/* The serial port can receive more of our data */
static void baum_accept_input(struct CharDriverState *chr)
static void baum_accept_input(struct Chardev *chr)
{
BaumDriverState *baum = (BaumDriverState *)chr;
BaumChardev *baum = (BaumChardev *)chr;
int room, first;
if (!baum->out_buf_used)
......@@ -279,9 +279,9 @@ static void baum_accept_input(struct CharDriverState *chr)
}
/* We want to send a packet */
static void baum_write_packet(BaumDriverState *baum, const uint8_t *buf, int len)
static void baum_write_packet(BaumChardev *baum, const uint8_t *buf, int len)
{
CharDriverState *chr = (CharDriverState *)baum;
Chardev *chr = (Chardev *)baum;
uint8_t io_buf[1 + 2 * len], *cur = io_buf;
int room;
*cur++ = ESC;
......@@ -322,14 +322,14 @@ static void baum_write_packet(BaumDriverState *baum, const uint8_t *buf, int len
/* Called when the other end seems to have a wrong idea of our display size */
static void baum_cellCount_timer_cb(void *opaque)
{
BaumDriverState *baum = opaque;
BaumChardev *baum = opaque;
uint8_t cell_count[] = { BAUM_RSP_CellCount, baum->x * baum->y };
DPRINTF("Timeout waiting for DisplayData, sending cell count\n");
baum_write_packet(baum, cell_count, sizeof(cell_count));
}
/* Try to interpret a whole incoming packet */
static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len)
static int baum_eat_packet(BaumChardev *baum, const uint8_t *buf, int len)
{
const uint8_t *cur = buf;
uint8_t req = 0;
......@@ -470,9 +470,9 @@ static int baum_eat_packet(BaumDriverState *baum, const uint8_t *buf, int len)
}
/* The other end is writing some data. Store it and try to interpret */
static int baum_write(CharDriverState *chr, const uint8_t *buf, int len)
static int baum_write(Chardev *chr, const uint8_t *buf, int len)
{
BaumDriverState *baum = (BaumDriverState *)chr;
BaumChardev *baum = (BaumChardev *)chr;
int tocopy, cur, eaten, orig_len = len;
if (!len)
......@@ -511,14 +511,16 @@ static int baum_write(CharDriverState *chr, const uint8_t *buf, int len)
}
/* Send the key code to the other end */
static void baum_send_key(BaumDriverState *baum, uint8_t type, uint8_t value) {
static void baum_send_key(BaumChardev *baum, uint8_t type, uint8_t value)
{
uint8_t packet[] = { type, value };
DPRINTF("writing key %x %x\n", type, value);
baum_write_packet(baum, packet, sizeof(packet));
}
static void baum_send_key2(BaumDriverState *baum, uint8_t type, uint8_t value,
uint8_t value2) {
static void baum_send_key2(BaumChardev *baum, uint8_t type, uint8_t value,
uint8_t value2)
{
uint8_t packet[] = { type, value, value2 };
DPRINTF("writing key %x %x\n", type, value);
baum_write_packet(baum, packet, sizeof(packet));
......@@ -527,7 +529,7 @@ static void baum_send_key2(BaumDriverState *baum, uint8_t type, uint8_t value,
/* We got some data on the BrlAPI socket */
static void baum_chr_read(void *opaque)
{
BaumDriverState *baum = opaque;
BaumChardev *baum = opaque;
brlapi_keyCode_t code;
int ret;
if (!baum->brlapi)
......@@ -611,9 +613,9 @@ static void baum_chr_read(void *opaque)
}
}
static void baum_free(struct CharDriverState *chr)
static void baum_free(struct Chardev *chr)
{
BaumDriverState *baum = (BaumDriverState *)chr;
BaumChardev *baum = (BaumChardev *)chr;
timer_free(baum->cellCount_timer);
if (baum->brlapi) {
......@@ -622,23 +624,23 @@ static void baum_free(struct CharDriverState *chr)
}
}
static CharDriverState *chr_baum_init(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
static Chardev *chr_baum_init(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
{
ChardevCommon *common = backend->u.braille.data;
BaumDriverState *baum;
CharDriverState *chr;
BaumChardev *baum;
Chardev *chr;
brlapi_handle_t *handle;
chr = qemu_chr_alloc(driver, common, errp);
if (!chr) {
return NULL;
}
baum = (BaumDriverState *)chr;
baum = (BaumChardev *)chr;
handle = g_malloc0(brlapi_getHandleSize());
baum->brlapi = handle;
......@@ -666,7 +668,7 @@ fail_handle:
static void register_types(void)
{
static const CharDriver driver = {
.instance_size = sizeof(BaumDriverState),
.instance_size = sizeof(BaumChardev),
.kind = CHARDEV_BACKEND_KIND_BRAILLE,
.create = chr_baum_init,
.chr_write = baum_write,
......
......@@ -31,7 +31,7 @@
#define MSMOUSE_HI2(n) (((n) & 0xc0) >> 6)
typedef struct {
CharDriverState parent;
Chardev parent;
QemuInputHandlerState *hs;
int axis[INPUT_AXIS__MAX];
......@@ -39,11 +39,11 @@ typedef struct {
bool btnc[INPUT_BUTTON__MAX];
uint8_t outbuf[32];
int outlen;
} MouseState;
} MouseChardev;
static void msmouse_chr_accept_input(CharDriverState *chr)
static void msmouse_chr_accept_input(Chardev *chr)
{
MouseState *mouse = (MouseState *)chr;
MouseChardev *mouse = (MouseChardev *)chr;
int len;
len = qemu_chr_be_can_write(chr);
......@@ -61,7 +61,7 @@ static void msmouse_chr_accept_input(CharDriverState *chr)
}
}
static void msmouse_queue_event(MouseState *mouse)
static void msmouse_queue_event(MouseChardev *mouse)
{
unsigned char bytes[4] = { 0x40, 0x00, 0x00, 0x00 };
int dx, dy, count = 3;
......@@ -98,7 +98,7 @@ static void msmouse_queue_event(MouseState *mouse)
static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
InputEvent *evt)
{
MouseState *mouse = (MouseState *)dev;
MouseChardev *mouse = (MouseChardev *)dev;
InputMoveEvent *move;
InputBtnEvent *btn;
......@@ -122,22 +122,22 @@ static void msmouse_input_event(DeviceState *dev, QemuConsole *src,
static void msmouse_input_sync(DeviceState *dev)
{
MouseState *mouse = (MouseState *)dev;
CharDriverState *chr = (CharDriverState *)dev;
MouseChardev *mouse = (MouseChardev *)dev;
Chardev *chr = (Chardev *)dev;
msmouse_queue_event(mouse);
msmouse_chr_accept_input(chr);
}
static int msmouse_chr_write (struct CharDriverState *s, const uint8_t *buf, int len)
static int msmouse_chr_write(struct Chardev *s, const uint8_t *buf, int len)
{
/* Ignore writes to mouse port */
return len;
}
static void msmouse_chr_free(struct CharDriverState *chr)
static void msmouse_chr_free(struct Chardev *chr)
{
MouseState *mouse = (MouseState *)chr;
MouseChardev *mouse = (MouseChardev *)chr;
qemu_input_handler_unregister(mouse->hs);
}
......@@ -149,16 +149,16 @@ static QemuInputHandler msmouse_handler = {
.sync = msmouse_input_sync,
};
static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
static Chardev *qemu_chr_open_msmouse(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
{
ChardevCommon *common = backend->u.msmouse.data;
MouseState *mouse;
CharDriverState *chr;
MouseChardev *mouse;
Chardev *chr;
chr = qemu_chr_alloc(driver, common, errp);
if (!chr) {
......@@ -166,7 +166,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
}
*be_opened = false;
mouse = (MouseState *)chr;
mouse = (MouseChardev *)chr;
mouse->hs = qemu_input_handler_register((DeviceState *)mouse,
&msmouse_handler);
......@@ -177,7 +177,7 @@ static CharDriverState *qemu_chr_open_msmouse(const CharDriver *driver,
static void register_types(void)
{
static const CharDriver driver = {
.instance_size = sizeof(MouseState),
.instance_size = sizeof(MouseChardev),
.kind = CHARDEV_BACKEND_KIND_MSMOUSE,
.create = qemu_chr_open_msmouse,
.chr_write = msmouse_chr_write,
......
......@@ -86,7 +86,7 @@ static void rng_egd_chr_read(void *opaque, const uint8_t *buf, int size)
static void rng_egd_opened(RngBackend *b, Error **errp)
{
RngEgd *s = RNG_EGD(b);
CharDriverState *chr;
Chardev *chr;
if (s->chr_name == NULL) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
......@@ -125,7 +125,7 @@ static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp)
static char *rng_egd_get_chardev(Object *obj, Error **errp)
{
RngEgd *s = RNG_EGD(obj);
CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
if (chr && chr->label) {
return g_strdup(chr->label);
......
......@@ -30,14 +30,14 @@
#define BUF_SIZE 32
typedef struct {
CharDriverState parent;
Chardev parent;
uint8_t in_buf[32];
int in_buf_used;
} TestdevCharState;
} TestdevChardev;
/* Try to interpret a whole incoming packet */
static int testdev_eat_packet(TestdevCharState *testdev)
static int testdev_eat_packet(TestdevChardev *testdev)
{
const uint8_t *cur = testdev->in_buf;
int len = testdev->in_buf_used;
......@@ -78,9 +78,9 @@ static int testdev_eat_packet(TestdevCharState *testdev)
}
/* The other end is writing some data. Store it and try to interpret */
static int testdev_write(CharDriverState *chr, const uint8_t *buf, int len)
static int testdev_write(Chardev *chr, const uint8_t *buf, int len)
{
TestdevCharState *testdev = (TestdevCharState *)chr;
TestdevChardev *testdev = (TestdevChardev *)chr;
int tocopy, eaten, orig_len = len;
while (len) {
......@@ -103,15 +103,15 @@ static int testdev_write(CharDriverState *chr, const uint8_t *buf, int len)
return orig_len;
}
static CharDriverState *chr_testdev_init(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
static Chardev *chr_testdev_init(const CharDriver *driver,
const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
bool *be_opened,
Error **errp)
{
TestdevCharState *testdev = g_new0(TestdevCharState, 1);;
CharDriverState *chr = (CharDriverState *)testdev;
TestdevChardev *testdev = g_new0(TestdevChardev, 1);;
Chardev *chr = (Chardev *)testdev;
chr->driver = driver;
......@@ -121,7 +121,7 @@ static CharDriverState *chr_testdev_init(const CharDriver *driver,
static void register_types(void)
{
static const CharDriver driver = {
.instance_size = sizeof(TestdevCharState),
.instance_size = sizeof(TestdevChardev),
.kind = CHARDEV_BACKEND_KIND_TESTDEV,
.create = chr_testdev_init,
.chr_write = testdev_write,
......
......@@ -305,7 +305,7 @@ typedef struct GDBState {
int running_state;
#else
CharBackend chr;
CharDriverState *mon_chr;
Chardev *mon_chr;
#endif
char syscall_buf[256];
gdb_syscall_complete_cb current_syscall_cb;
......@@ -1473,7 +1473,7 @@ void gdb_exit(CPUArchState *env, int code)
GDBState *s;
char buf[4];
#ifndef CONFIG_USER_ONLY
CharDriverState *chr;
Chardev *chr;
#endif
s = gdbserver_state;
......@@ -1698,7 +1698,7 @@ static void gdb_monitor_output(GDBState *s, const char *msg, int len)
put_packet(s, buf);
}
static int gdb_monitor_write(CharDriverState *chr, const uint8_t *buf, int len)
static int gdb_monitor_write(Chardev *chr, const uint8_t *buf, int len)
{
const char *p = (const char *)buf;
int max_sz;
......@@ -1729,11 +1729,11 @@ int gdbserver_start(const char *device)
{
GDBState *s;
char gdbstub_device_name[128];
CharDriverState *chr = NULL;
CharDriverState *mon_chr;
Chardev *chr = NULL;
Chardev *mon_chr;
ChardevCommon common = { 0 };
static const CharDriver driver = {
.instance_size = sizeof(CharDriverState),
.instance_size = sizeof(Chardev),
.kind = -1,
.chr_write = gdb_monitor_write,
};
......
......@@ -118,7 +118,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
};
if (i < MAX_SERIAL_PORTS) {
CharDriverState *chr;
Chardev *chr;
chr = serial_hds[i];
......
......@@ -107,7 +107,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
};
if (i < MAX_SERIAL_PORTS) {
CharDriverState *chr;
Chardev *chr;
chr = serial_hds[i];
......
......@@ -187,7 +187,7 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
};
if (i < MAX_SERIAL_PORTS) {
CharDriverState *chr;
Chardev *chr;
chr = serial_hds[i];
......
......@@ -786,7 +786,7 @@ static void n8x0_cbus_setup(struct n800_s *s)
static void n8x0_uart_setup(struct n800_s *s)
{
CharDriverState *radio = uart_hci_init();
Chardev *radio = uart_hci_init();
qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO,
csrhci_pins_get(radio)[csrhci_pin_reset]);
......
......@@ -792,7 +792,7 @@ static const MemoryRegionOps omap_sti_fifo_ops = {
static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
MemoryRegion *sysmem,
hwaddr channel_base, qemu_irq irq, omap_clk clk,
CharDriverState *chr)
Chardev *chr)
{
struct omap_sti_s *s = g_new0(struct omap_sti_s, 1);
......
......@@ -2024,7 +2024,7 @@ static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem,
hwaddr base,
qemu_irq irq, qemu_irq rx_dma,
qemu_irq tx_dma,
CharDriverState *chr)
Chardev *chr)
{
DeviceState *dev;
SysBusDevice *sbd;
......
......@@ -613,7 +613,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic)
}
static void create_uart(const VirtMachineState *vms, qemu_irq *pic, int uart,
MemoryRegion *mem, CharDriverState *chr)
MemoryRegion *mem, Chardev *chr)
{
char *nodename;
hwaddr base = vms->memmap[uart].base;
......
......@@ -29,7 +29,7 @@
#include "qapi/error.h"
struct csrhci_s {
CharDriverState parent;
Chardev parent;
int enable;
qemu_irq *pins;
int pin_state;
......@@ -79,7 +79,7 @@ enum {
static inline void csrhci_fifo_wake(struct csrhci_s *s)
{
CharDriverState *chr = (CharDriverState *)s;
Chardev *chr = (Chardev *)s;
CharBackend *be = chr->be;
if (!s->enable || !s->out_len)
......@@ -313,7 +313,7 @@ static void csrhci_ready_for_next_inpkt(struct csrhci_s *s)
s->in_hdr = INT_MAX;
}
static int csrhci_write(struct CharDriverState *chr,
static int csrhci_write(struct Chardev *chr,
const uint8_t *buf, int len)
{
struct csrhci_s *s = (struct csrhci_s *)chr;
......@@ -386,7 +386,7 @@ static void csrhci_out_hci_packet_acl(void *opaque,
csrhci_fifo_wake(s);
}
static int csrhci_ioctl(struct CharDriverState *chr, int cmd, void *arg)
static int csrhci_ioctl(struct Chardev *chr, int cmd, void *arg)
{
QEMUSerialSetParams *ssp;
struct csrhci_s *s = (struct csrhci_s *) chr;
......@@ -455,14 +455,14 @@ static void csrhci_pins(void *opaque, int line, int level)
}
}
qemu_irq *csrhci_pins_get(CharDriverState *chr)
qemu_irq *csrhci_pins_get(Chardev *chr)
{
struct csrhci_s *s = (struct csrhci_s *) chr;
return s->pins;
}
CharDriverState *uart_hci_init(void)
Chardev *uart_hci_init(void)
{
static const CharDriver hci_driver = {
.instance_size = sizeof(struct csrhci_s),
......@@ -472,7 +472,7 @@ CharDriverState *uart_hci_init(void)
};
Error *err = NULL;
ChardevCommon common = { 0, };
CharDriverState *chr = qemu_chr_alloc(&hci_driver, &common, &err);
Chardev *chr = qemu_chr_alloc(&hci_driver, &common, &err);
struct csrhci_s *s = (struct csrhci_s *)chr;
if (err) {
......
......@@ -689,7 +689,7 @@ static const VMStateDescription vmstate_escc = {
};
MemoryRegion *escc_init(hwaddr base, qemu_irq irqA, qemu_irq irqB,
CharDriverState *chrA, CharDriverState *chrB,
Chardev *chrA, Chardev *chrB,
int clock, int it_shift)
{
DeviceState *dev;
......
......@@ -586,7 +586,7 @@ static const VMStateDescription vmstate_exynos4210_uart = {
DeviceState *exynos4210_uart_create(hwaddr addr,
int fifo_size,
int channel,
CharDriverState *chr,
Chardev *chr,
qemu_irq irq)
{
DeviceState *dev;
......
......@@ -170,7 +170,7 @@ static void imx_serial_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
IMXSerialState *s = (IMXSerialState *)opaque;
CharDriverState *chr = qemu_chr_fe_get_driver(&s->chr);
Chardev *chr = qemu_chr_fe_get_driver(&s->chr);
unsigned char ch;
DPRINTF("write(offset=0x%" HWADDR_PRIx ", value = 0x%x) to %s\n",
......
......@@ -275,7 +275,7 @@ static void mcf_uart_receive(void *opaque, const uint8_t *buf, int size)
mcf_uart_push_byte(s, buf[0]);
}
void *mcf_uart_init(qemu_irq irq, CharDriverState *chr)
void *mcf_uart_init(qemu_irq irq, Chardev *chr)
{
mcf_uart_state *s;
......@@ -300,7 +300,7 @@ static const MemoryRegionOps mcf_uart_ops = {
void mcf_uart_mm_init(MemoryRegion *sysmem,
hwaddr base,
qemu_irq irq,
CharDriverState *chr)
Chardev *chr)
{
mcf_uart_state *s;
......
......@@ -54,7 +54,7 @@ void omap_uart_reset(struct omap_uart_s *s)
struct omap_uart_s *omap_uart_init(hwaddr base,
qemu_irq irq, omap_clk fclk, omap_clk iclk,
qemu_irq txdma, qemu_irq rxdma,
const char *label, CharDriverState *chr)
const char *label, Chardev *chr)
{
struct omap_uart_s *s = g_new0(struct omap_uart_s, 1);
......@@ -163,7 +163,7 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
struct omap_target_agent_s *ta,
qemu_irq irq, omap_clk fclk, omap_clk iclk,
qemu_irq txdma, qemu_irq rxdma,
const char *label, CharDriverState *chr)
const char *label, Chardev *chr)
{
hwaddr base = omap_l4_attach(ta, 0, NULL);
struct omap_uart_s *s = omap_uart_init(base, irq,
......@@ -178,7 +178,7 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
return s;
}
void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr)
void omap_uart_attach(struct omap_uart_s *s, Chardev *chr)
{
/* TODO: Should reuse or destroy current s->serial */
s->serial = serial_mm_init(get_system_memory(), s->base, 2, s->irq,
......
......@@ -603,7 +603,7 @@ static const MemoryRegionOps parallel_mm_ops = {
/* If fd is zero, it means that the parallel device uses the console */
bool parallel_mm_init(MemoryRegion *address_space,
hwaddr base, int it_shift, qemu_irq irq,
CharDriverState *chr)
Chardev *chr)
{
ParallelState *s;
......
......@@ -121,7 +121,7 @@ static void serial_register_types(void)
type_init(serial_register_types)
static void serial_isa_init(ISABus *bus, int index, CharDriverState *chr)
static void serial_isa_init(ISABus *bus, int index, Chardev *chr)
{
DeviceState *dev;
ISADevice *isadev;
......
......@@ -937,7 +937,7 @@ const MemoryRegionOps serial_io_ops = {
};
SerialState *serial_init(int base, qemu_irq irq, int baudbase,
CharDriverState *chr, MemoryRegion *system_io)
Chardev *chr, MemoryRegion *system_io)
{
SerialState *s;
......@@ -993,7 +993,7 @@ static const MemoryRegionOps serial_mm_ops[3] = {
SerialState *serial_mm_init(MemoryRegion *address_space,
hwaddr base, int it_shift,
qemu_irq irq, int baudbase,
CharDriverState *chr, enum device_endian end)
Chardev *chr, enum device_endian end)
{
SerialState *s;
......
......@@ -356,7 +356,7 @@ static const MemoryRegionOps sh_serial_ops = {
void sh_serial_init(MemoryRegion *sysmem,
hwaddr base, int feat,
uint32_t freq, CharDriverState *chr,
uint32_t freq, Chardev *chr,
qemu_irq eri_source,
qemu_irq rxi_source,
qemu_irq txi_source,
......
......@@ -141,7 +141,7 @@ static target_ulong h_get_term_char(PowerPCCPU *cpu, sPAPRMachineState *spapr,
return H_SUCCESS;
}
void spapr_vty_create(VIOsPAPRBus *bus, CharDriverState *chardev)
void spapr_vty_create(VIOsPAPRBus *bus, Chardev *chardev)
{
DeviceState *dev;
......
......@@ -168,7 +168,7 @@ static void virtconsole_realize(DeviceState *dev, Error **errp)
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
VirtConsole *vcon = VIRTIO_CONSOLE(dev);
VirtIOSerialPortClass *k = VIRTIO_SERIAL_PORT_GET_CLASS(dev);
CharDriverState *chr = qemu_chr_fe_get_driver(&vcon->chr);
Chardev *chr = qemu_chr_fe_get_driver(&vcon->chr);
if (port->id == 0 && !k->is_console) {
error_setg(errp, "Port number 0 on virtio-serial devices reserved "
......
......@@ -179,7 +179,7 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,
Error *local_err = NULL;
Property *prop = opaque;
CharBackend *be = qdev_get_prop_ptr(dev, prop);
CharDriverState *s;
Chardev *s;
char *str;
if (dev->realized) {
......@@ -411,7 +411,7 @@ void qdev_prop_set_drive(DeviceState *dev, const char *name,
}
void qdev_prop_set_chr(DeviceState *dev, const char *name,
CharDriverState *value)
Chardev *value)
{
assert(!value || value->label);
object_property_set_str(OBJECT(dev),
......
......@@ -85,7 +85,7 @@ struct MilkymistTMU2State {
SysBusDevice parent_obj;
MemoryRegion regs_region;
CharDriverState *chr;
Chardev *chr;
qemu_irq irq;
uint32_t regs[R_MAX];
......
......@@ -1392,7 +1392,7 @@ static const GraphicHwOps sm501_ops = {
};
void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
uint32_t local_mem_bytes, qemu_irq irq, CharDriverState *chr)
uint32_t local_mem_bytes, qemu_irq irq, Chardev *chr)
{
SM501State * s;
DeviceState *dev;
......
......@@ -288,7 +288,7 @@ MemoryRegion *isa_address_space_io(ISADevice *dev)
type_init(isabus_register_types)
static void parallel_init(ISABus *bus, int index, CharDriverState *chr)
static void parallel_init(ISABus *bus, int index, Chardev *chr)
{
DeviceState *dev;