console: add GraphicHwOps

Pass a single GraphicHwOps struct pointer to graphic_console_init,
instead of a bunch of function pointers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2013-03-13 14:04:18 +01:00
parent 27be55872d
commit 380cd056ec
26 changed files with 155 additions and 104 deletions

View file

@ -254,6 +254,12 @@ static const VMStateDescription vmstate_jazz_led = {
}
};
static const GraphicHwOps jazz_led_ops = {
.invalidate = jazz_led_invalidate_display,
.gfx_update = jazz_led_update_display,
.text_update = jazz_led_text_update,
};
static int jazz_led_init(SysBusDevice *dev)
{
LedState *s = FROM_SYSBUS(LedState, dev);
@ -261,9 +267,7 @@ static int jazz_led_init(SysBusDevice *dev)
memory_region_init_io(&s->iomem, &led_ops, s, "led", 1);
sysbus_init_mmio(dev, &s->iomem);
s->con = graphic_console_init(jazz_led_update_display,
jazz_led_invalidate_display,
jazz_led_text_update, s);
s->con = graphic_console_init(&jazz_led_ops, s);
return 0;
}