static void usb_serial_realize(USBDevice *dev, Error **errp)

{

    USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);



    usb_desc_create_serial(dev);

    usb_desc_init(dev);

    dev->auto_attach = 0;



    if (!s->cs) {

        error_setg(errp, "Property chardev is required");

        return;

    }



    qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,

                          usb_serial_event, s);

    usb_serial_handle_reset(dev);



    if (s->cs->be_open && !dev->attached) {

        usb_device_attach(dev, errp);

    }

}

static void usb_serial_realize(USBDevice *dev, Error **errp)

{

    USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev);



    usb_desc_create_serial(dev);

    usb_desc_init(dev);

    dev->auto_attach = 0;



    if (!s->cs) {

        error_setg(errp, "Property chardev is required");

        return;

    }



    qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,

                          usb_serial_event, s);

    usb_serial_handle_reset(dev);



    if (s->cs->be_open && !dev->attached) {

        usb_device_attach(dev, errp);

    }

}

static void FUNC_0(USBDevice *VAR_0, Error **VAR_1)

{

    USBSerialState *s = DO_UPCAST(USBSerialState, VAR_0, VAR_0);



    usb_desc_create_serial(VAR_0);

    usb_desc_init(VAR_0);

    VAR_0->auto_attach = 0;



    if (!s->cs) {

        error_setg(VAR_1, "Property chardev is required");

        return;

    }



    qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,

                          usb_serial_event, s);

    usb_serial_handle_reset(VAR_0);



    if (s->cs->be_open && !VAR_0->attached) {

        usb_device_attach(VAR_0, VAR_1);

    }

}

static void FUNC_0(USBDevice *VAR_0, Error **VAR_1)
{ USBSerialState *s = DO_UPCAST(USBSerialState, VAR_0, VAR_0); usb_desc_create_serial(VAR_0); usb_desc_init(VAR_0); VAR_0->auto_attach = 0; if (!s->cs) { error_setg(VAR_1, "Property chardev is required"); return; } qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,
usb_serial_event, s); usb_serial_handle_reset(VAR_0); if (s->cs->be_open && !VAR_0->attached) { usb_device_attach(VAR_0, VAR_1); } }