Message ID | 2b7a5594c8c41dcae0ade3354a13540f83570ab0.1602965621.git.balaton@eik.bme.hu |
---|---|
State | New |
Headers | show |
Series | m48t59: remove legacy init functions | expand |
On 10/17/20 10:13 PM, BALATON Zoltan via wrote: > Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> > --- > hw/sparc64/sun4u.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c > index ad5ca2472a..a89ebed6f0 100644 > --- a/hw/sparc64/sun4u.c > +++ b/hw/sparc64/sun4u.c > @@ -671,10 +671,12 @@ static void sun4uv_init(MemoryRegion *address_space_mem, > pci_ide_create_devs(pci_dev); > > /* Map NVRAM into I/O (ebus) space */ > - nvram = m48t59_init(NULL, 0, 0, NVRAM_SIZE, 1968, 59); > - s = SYS_BUS_DEVICE(nvram); > + dev = qdev_new("sysbus-m48t59"); > + s = SYS_BUS_DEVICE(dev); > + sysbus_realize_and_unref(s, &error_fatal); I'd use &error_abort here (so if that ever happens, it is easier to debug it), otherwise: Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > memory_region_add_subregion(pci_address_space_io(ebus), 0x2000, > sysbus_mmio_get_region(s, 0)); > + nvram = NVRAM(dev); > > initrd_size = 0; > initrd_addr = 0; >
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index ad5ca2472a..a89ebed6f0 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -671,10 +671,12 @@ static void sun4uv_init(MemoryRegion *address_space_mem, pci_ide_create_devs(pci_dev); /* Map NVRAM into I/O (ebus) space */ - nvram = m48t59_init(NULL, 0, 0, NVRAM_SIZE, 1968, 59); - s = SYS_BUS_DEVICE(nvram); + dev = qdev_new("sysbus-m48t59"); + s = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(s, &error_fatal); memory_region_add_subregion(pci_address_space_io(ebus), 0x2000, sysbus_mmio_get_region(s, 0)); + nvram = NVRAM(dev); initrd_size = 0; initrd_addr = 0;
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> --- hw/sparc64/sun4u.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)