static int usb_qdev_init(DeviceState *qdev)

{

    USBDevice *dev = USB_DEVICE(qdev);

    int rc;



    pstrcpy(dev->product_desc, sizeof(dev->product_desc),

            usb_device_get_product_desc(dev));

    dev->auto_attach = 1;

    QLIST_INIT(&dev->strings);

    usb_ep_init(dev);

    rc = usb_claim_port(dev);

    if (rc != 0) {

        return rc;

    }

    rc = usb_device_init(dev);

    if (rc != 0) {

        usb_release_port(dev);

        return rc;

    }

    if (dev->auto_attach) {

        rc = usb_device_attach(dev);

        if (rc != 0) {

            usb_qdev_exit(qdev);

            return rc;

        }

    }

    return 0;

}

static int usb_qdev_init(DeviceState *qdev)

{

    USBDevice *dev = USB_DEVICE(qdev);

    int rc;



    pstrcpy(dev->product_desc, sizeof(dev->product_desc),

            usb_device_get_product_desc(dev));

    dev->auto_attach = 1;

    QLIST_INIT(&dev->strings);

    usb_ep_init(dev);

    rc = usb_claim_port(dev);

    if (rc != 0) {

        return rc;

    }

    rc = usb_device_init(dev);

    if (rc != 0) {

        usb_release_port(dev);

        return rc;

    }

    if (dev->auto_attach) {

        rc = usb_device_attach(dev);

        if (rc != 0) {

            usb_qdev_exit(qdev);

            return rc;

        }

    }

    return 0;

}

static int FUNC_0(DeviceState *VAR_0)

{

    USBDevice *dev = USB_DEVICE(VAR_0);

    int VAR_1;



    pstrcpy(dev->product_desc, sizeof(dev->product_desc),

            usb_device_get_product_desc(dev));

    dev->auto_attach = 1;

    QLIST_INIT(&dev->strings);

    usb_ep_init(dev);

    VAR_1 = usb_claim_port(dev);

    if (VAR_1 != 0) {

        return VAR_1;

    }

    VAR_1 = usb_device_init(dev);

    if (VAR_1 != 0) {

        usb_release_port(dev);

        return VAR_1;

    }

    if (dev->auto_attach) {

        VAR_1 = usb_device_attach(dev);

        if (VAR_1 != 0) {

            usb_qdev_exit(VAR_0);

            return VAR_1;

        }

    }

    return 0;

}

static int FUNC_0(DeviceState *VAR_0)
{ USBDevice *dev = USB_DEVICE(VAR_0); int VAR_1; pstrcpy(dev->product_desc, sizeof(dev->product_desc),
usb_device_get_product_desc(dev)); dev->auto_attach = 1; QLIST_INIT(&dev->strings); usb_ep_init(dev); VAR_1 = usb_claim_port(dev); if (VAR_1 != 0) { return VAR_1; } VAR_1 = usb_device_init(dev); if (VAR_1 != 0) { usb_release_port(dev); return VAR_1; } if (dev->auto_attach) { VAR_1 = usb_device_attach(dev); if (VAR_1 != 0) { usb_qdev_exit(VAR_0); return VAR_1; } } return 0; }