Skip to content

Commit

Permalink
hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device res…
Browse files Browse the repository at this point in the history
…et method

Convert the gt64120_reset() function into a proper Device reset method.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-8-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
philmd authored and ehabkost committed Oct 24, 2018
1 parent e800894 commit 43fd7bb
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions hw/mips/gt64xxx_pci.c
Expand Up @@ -992,9 +992,9 @@ static void gt64120_pci_set_irq(void *opaque, int irq_num, int level)
}


static void gt64120_reset(void *opaque)
static void gt64120_reset(DeviceState *dev)
{
GT64120State *s = opaque;
GT64120State *s = GT64120_PCI_HOST_BRIDGE(dev);

/* FIXME: Malta specific hw assumptions ahead */

Expand Down Expand Up @@ -1184,16 +1184,6 @@ PCIBus *gt64120_register(qemu_irq *pic)
return phb->bus;
}

static int gt64120_init(SysBusDevice *dev)
{
GT64120State *s;

s = GT64120_PCI_HOST_BRIDGE(dev);

qemu_register_reset(gt64120_reset, s);
return 0;
}

static void gt64120_pci_realize(PCIDevice *d, Error **errp)
{
/* FIXME: Malta specific hw assumptions ahead */
Expand Down Expand Up @@ -1241,9 +1231,8 @@ static const TypeInfo gt64120_pci_info = {
static void gt64120_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass);

sdc->init = gt64120_init;
dc->reset = gt64120_reset;
dc->vmsd = &vmstate_gt64120;
}

Expand Down

0 comments on commit 43fd7bb

Please sign in to comment.