mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
hw/usb: Inline usb_try_new()
Inline the single use of usb_try_new(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Message-Id: <20240216110313.17039-10-philmd@linaro.org>
This commit is contained in:
parent
901b78a0ee
commit
8bf6275f7e
2 changed files with 1 additions and 6 deletions
|
@ -411,7 +411,7 @@ void usb_claim_port(USBDevice *dev, Error **errp)
|
|||
} else {
|
||||
if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) {
|
||||
/* Create a new hub and chain it on */
|
||||
hub = usb_try_new("usb-hub");
|
||||
hub = USB_DEVICE(qdev_try_new("usb-hub"));
|
||||
if (hub) {
|
||||
usb_realize_and_unref(hub, bus, NULL);
|
||||
}
|
||||
|
|
|
@ -584,11 +584,6 @@ static inline USBDevice *usb_new(const char *name)
|
|||
return USB_DEVICE(qdev_new(name));
|
||||
}
|
||||
|
||||
static inline USBDevice *usb_try_new(const char *name)
|
||||
{
|
||||
return USB_DEVICE(qdev_try_new(name));
|
||||
}
|
||||
|
||||
static inline bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp)
|
||||
{
|
||||
return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue