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>
This commit is contained in:
parent
d6c5f066ab
commit
cffac71b7c
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user