• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision23251fb82f2fda426901f8d6950276391e2446d8 (tree)
l'heure2018-12-13 22:48:02
AuteurMao Zhongyi <maozhongyi@cmss...>
CommiterPeter Maydell

Message de Log

timer/grlib_gptimer: Convert sysbus init function to realize function

Use DeviceClass rather than SysBusDeviceClass in
grlib_gptimer_class_init().

Cc: chouteau@adacore.com

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181130093852.20739-18-maozhongyi@cmss.chinamobile.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Change Summary

Modification

--- a/hw/timer/grlib_gptimer.c
+++ b/hw/timer/grlib_gptimer.c
@@ -347,10 +347,11 @@ static void grlib_gptimer_reset(DeviceState *d)
347347 }
348348 }
349349
350-static int grlib_gptimer_init(SysBusDevice *dev)
350+static void grlib_gptimer_realize(DeviceState *dev, Error **errp)
351351 {
352352 GPTimerUnit *unit = GRLIB_GPTIMER(dev);
353353 unsigned int i;
354+ SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
354355
355356 assert(unit->nr_timers > 0);
356357 assert(unit->nr_timers <= GPTIMER_MAX_TIMERS);
@@ -366,7 +367,7 @@ static int grlib_gptimer_init(SysBusDevice *dev)
366367 timer->id = i;
367368
368369 /* One IRQ line for each timer */
369- sysbus_init_irq(dev, &timer->irq);
370+ sysbus_init_irq(sbd, &timer->irq);
370371
371372 ptimer_set_freq(timer->ptimer, unit->freq_hz);
372373 }
@@ -375,8 +376,7 @@ static int grlib_gptimer_init(SysBusDevice *dev)
375376 unit, "gptimer",
376377 UNIT_REG_SIZE + GPTIMER_REG_SIZE * unit->nr_timers);
377378
378- sysbus_init_mmio(dev, &unit->iomem);
379- return 0;
379+ sysbus_init_mmio(sbd, &unit->iomem);
380380 }
381381
382382 static Property grlib_gptimer_properties[] = {
@@ -389,9 +389,8 @@ static Property grlib_gptimer_properties[] = {
389389 static void grlib_gptimer_class_init(ObjectClass *klass, void *data)
390390 {
391391 DeviceClass *dc = DEVICE_CLASS(klass);
392- SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
393392
394- k->init = grlib_gptimer_init;
393+ dc->realize = grlib_gptimer_realize;
395394 dc->reset = grlib_gptimer_reset;
396395 dc->props = grlib_gptimer_properties;
397396 }