[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 8/9] mips/loongson3_virt: do not require CONFIG_USB
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH v3 8/9] mips/loongson3_virt: do not require CONFIG_USB |
Date: |
Thu, 15 Feb 2024 12:12:57 +0100 |
On Thu, Feb 15, 2024 at 8:55 AM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
> > if (defaults_enabled() && object_class_by_name("pci-ohci")) {
> > pci_create_simple(pci_bus, -1, "pci-ohci");
> > - usb_create_simple(usb_bus_find(-1), "usb-kbd");
> > - usb_create_simple(usb_bus_find(-1), "usb-tablet");
> > + Object *usb_bus = object_resolve_path_type("", TYPE_USB_BUS, NULL);
> > + usb_create_simple(USB_BUS(usb_bus), "usb-kbd");
> > + usb_create_simple(USB_BUS(usb_bus), "usb-tablet");
> > }
> >
> > pci_init_nic_devices(pci_bus, mc->default_nic);
>
> Can we remove usb_bus_find() completely instead?
s/instead/in fact/
Yes, we can, but this would be just one patch in that series...
Paolo
> $ git grep -w usb_bus_find
> hw/hppa/machine.c:401: usb_create_simple(usb_bus_find(-1),
> "usb-kbd");
> hw/hppa/machine.c:402: usb_create_simple(usb_bus_find(-1),
> "usb-mouse");
> hw/mips/loongson3_virt.c:450: usb_create_simple(usb_bus_find(-1),
> "usb-kbd");
> hw/mips/loongson3_virt.c:451: usb_create_simple(usb_bus_find(-1),
> "usb-tablet");
> hw/ppc/mac_newworld.c:434: USBBus *usb_bus = usb_bus_find(-1);
> hw/ppc/sam460ex.c:423: usb_create_simple(usb_bus_find(-1), "usb-kbd");
> hw/ppc/sam460ex.c:424: usb_create_simple(usb_bus_find(-1), "usb-mouse");
> hw/ppc/spapr.c:3027: USBBus *usb_bus = usb_bus_find(-1);
> hw/sh4/r2d.c:315: usb_create_simple(usb_bus_find(-1), "usb-kbd");
> hw/usb/bus.c:103:USBBus *usb_bus_find(int busnr)
> hw/usb/bus.c:669: USBBus *bus = usb_bus_find(-1 /* any */);
> include/hw/usb.h:500:USBBus *usb_bus_find(int busnr);
- [PATCH v3 3/9] hw/mips/Kconfig: Remove ISA dependencies from MIPSsim board, (continued)
- [PATCH v3 3/9] hw/mips/Kconfig: Remove ISA dependencies from MIPSsim board, Paolo Bonzini, 2024/02/13
- [PATCH v3 2/9] isa: clean up Kconfig selections for ISA_SUPERIO, Paolo Bonzini, 2024/02/13
- [PATCH v3 4/9] isa: fix ISA_SUPERIO dependencies, Paolo Bonzini, 2024/02/13
- [PATCH v3 5/9] isa: specify instance_size in isa_superio_type_info, Paolo Bonzini, 2024/02/13
- [PATCH v3 6/9] isa: extract FDC37M81X to a separate file, Paolo Bonzini, 2024/02/13
- [PATCH v3 7/9] mips: allow compiling out CONFIG_MIPS_ITU, Paolo Bonzini, 2024/02/13
- [PATCH v3 9/9] mips: do not list individual devices from configs/, Paolo Bonzini, 2024/02/13
- [PATCH v3 8/9] mips/loongson3_virt: do not require CONFIG_USB, Paolo Bonzini, 2024/02/13
- Re: [PATCH v3 0/9] mips: do not list individual devices from configs/, Philippe Mathieu-Daudé, 2024/02/15