On Fri, Apr 20, 2018 at 09:22:55AM +0200, Markus Armbruster wrote: > Philippe Mathieu-Daudé <f4...@amsat.org> writes: > > > On 04/19/2018 06:27 PM, Philippe Mathieu-Daudé wrote: > >> The SysBusDevice is the last DeviceClass::init user. > >> > >> Instead of using > >> SysBusDeviceClass::realize > >> -> DeviceClass::realize > >> -> DeviceClass::init > >> -> sysbus_device_init > >> -> SysBusDeviceClass::init > >> > >> Simplify the path by directly calling SysBusDeviceClass::init > >> in SysBusDeviceClass::realize: > >> > >> SysBusDeviceClass::realize > >> -> SysBusDeviceClass::init > >> > >> Finally, remove the DeviceClass::init, there are no more users. > >> > >> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> > >> --- > >> include/hw/qdev-core.h | 2 -- > >> hw/core/qdev.c | 14 -------------- > >> hw/core/sysbus.c | 15 ++++++++++----- > >> 3 files changed, 10 insertions(+), 21 deletions(-) > >> > >> diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h > >> index 9453588160..6f60748043 100644 > >> --- a/include/hw/qdev-core.h > >> +++ b/include/hw/qdev-core.h > >> @@ -29,7 +29,6 @@ typedef enum DeviceCategory { > >> DEVICE_CATEGORY_MAX > >> } DeviceCategory; > >> > >> -typedef int (*qdev_initfn)(DeviceState *dev); > >> typedef int (*qdev_event)(DeviceState *dev); > >> typedef void (*DeviceRealize)(DeviceState *dev, Error **errp); > >> typedef void (*DeviceUnrealize)(DeviceState *dev, Error **errp); > >> @@ -124,7 +123,6 @@ typedef struct DeviceClass { > >> const struct VMStateDescription *vmsd; > >> > >> /* Private to qdev / bus. */ > >> - qdev_initfn init; /* TODO remove, once users are converted to realize > >> */ > > > > The DeviceClass documentation (top of this file) is now out of date :( > > > > If the maintainer taking this series prefer a respin, I plan to only > > remove the 'init' references in the big comment. > > I'd move the actual removal into the next and final patch. Lets us fix > up the comment in one go.
I'd prefer a respin, so we can ensure the documentation is updated and the removal of DeviceClass::init and DeviceClass::exit are done in the same patch. (Sorry for taking so long to reply.) -- Eduardo