diff options
author | Mao Zhongyi <maozhongyi@cmss.chinamobile.com> | 2018-12-13 13:48:02 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-12-13 13:48:02 +0000 |
commit | f7c5f21eaa630e9ee41dd6aa9b9cb7a0ff54a12c (patch) | |
tree | dd23cf22796aa89d7d902a0bfe61e4ec6f99c3b8 /hw/usb/tusb6010.c | |
parent | 30735a2b884fac4ad4e81fc82cd4c6b240bf74ea (diff) | |
download | qemu-f7c5f21eaa630e9ee41dd6aa9b9cb7a0ff54a12c.zip |
usb/tusb6010: Convert sysbus init function to realize function
Use DeviceClass rather than SysBusDeviceClass in
tusb6010_class_init().
Cc: kraxel@redhat.com
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Message-id: 20181130093852.20739-20-maozhongyi@cmss.chinamobile.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/usb/tusb6010.c')
-rw-r--r-- | hw/usb/tusb6010.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index a2128024c1..501706e2b2 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -808,10 +808,10 @@ static void tusb6010_reset(DeviceState *dev) musb_reset(s->musb); } -static int tusb6010_init(SysBusDevice *sbd) +static void tusb6010_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(sbd); TUSBState *s = TUSB(dev); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); s->otg_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s); s->pwr_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_power_tick, s); @@ -822,15 +822,13 @@ static int tusb6010_init(SysBusDevice *sbd) sysbus_init_irq(sbd, &s->irq); qdev_init_gpio_in(dev, tusb6010_irq, musb_irq_max + 1); s->musb = musb_init(dev, 1); - return 0; } static void tusb6010_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = tusb6010_init; + dc->realize = tusb6010_realize; dc->reset = tusb6010_reset; } |