summaryrefslogtreecommitdiff
path: root/hw/bitbang_i2c.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-11-14 12:59:29 +0200
committerAvi Kivity <avi@redhat.com>2011-11-24 18:32:00 +0200
commitcffac71b7cc30cc510a5644a7436e6a49e1ecb46 (patch)
treed59dd7cb49066b26b53cf01e4c3faa97f74531cc /hw/bitbang_i2c.c
parentd6c5f066ab6b81f82dfdac6082e5d4176783e5c9 (diff)
downloadqemu-cffac71b7cc30cc510a5644a7436e6a49e1ecb46.tar.gz
bitbang_i2c: avoid call to sysbus_init_mmio()
Instead of calling sysbus_init_mmio() with a null region, create a dummy region using the memory API. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/bitbang_i2c.c')
-rw-r--r--hw/bitbang_i2c.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/bitbang_i2c.c b/hw/bitbang_i2c.c
index 431359d615..71dd5951e9 100644
--- a/hw/bitbang_i2c.c
+++ b/hw/bitbang_i2c.c
@@ -184,6 +184,7 @@ bitbang_i2c_interface *bitbang_i2c_init(i2c_bus *bus)
/* GPIO interface. */
typedef struct {
SysBusDevice busdev;
+ MemoryRegion dummy_iomem;
bitbang_i2c_interface *bitbang;
int last_level;
qemu_irq out;
@@ -205,7 +206,8 @@ static int gpio_i2c_init(SysBusDevice *dev)
GPIOI2CState *s = FROM_SYSBUS(GPIOI2CState, dev);
i2c_bus *bus;
- sysbus_init_mmio(dev, 0x0, 0);
+ memory_region_init(&s->dummy_iomem, "gpio_i2c", 0);
+ sysbus_init_mmio_region(dev, &s->dummy_iomem);
bus = i2c_init_bus(&dev->qdev, "i2c");
s->bitbang = bitbang_i2c_init(bus);