Peter Maydell <peter.mayd...@linaro.org> writes: > On Mon, 16 Nov 2020 at 17:09, Markus Armbruster <arm...@redhat.com> wrote: >> But TYPE_CPRMAN_PLL is *not* a descendant of TYPE_SYS_BUS_DEVICE, it's a >> bus-less device: >> >> static const TypeInfo cprman_pll_info = { >> .name = TYPE_CPRMAN_PLL, >> ---> .parent = TYPE_DEVICE, >> .instance_size = sizeof(CprmanPllState), >> .class_init = pll_class_init, >> .instance_init = pll_init, >> }; > > I'm really dubious of devices that directly inherit from > TYPE_DEVICE, because their reset method won't be automatically > called. In this case it looks like the TYPE_BCM2835_CPRMAN > device's reset method manually calls reset on these devices, > though, so it isn't actually buggy, just confusing.
I guess this is a trap for unwary implementers, aggravated by our usual dearth of qdev documentation. I can see ~100 .parent = TYPE_DEVICE lines. Checking them all manually won't be fun. Any automation ideas? The concept "bus-less device" is sane. We used not to have it, and the resulting need for pseudo-busses was annoying enough to make us add bus-less devices.