aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/megasas.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-09 19:17:28 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-10 11:18:23 +0100
commitae071cc851d7150d3a9950c642570830bb85729e (patch)
treea761f5f4a545b7071b036534c7ad7960ec046fe7 /hw/scsi/megasas.c
parent390e90a90736f98ca47f2e767d7f2a15d68d6bc4 (diff)
scsi: Convert remaining PCI HBAs to realize()
These are "am53c974", "dc390", "lsi53c895a", "lsi53c810", "megasas", "megasas-gen2". Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Message-Id: <1425925048-15482-5-git-send-email-armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/megasas.c')
-rw-r--r--hw/scsi/megasas.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 69ffdbd724..bf83b65383 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -28,7 +28,6 @@
#include "hw/scsi/scsi.h"
#include "block/scsi.h"
#include "trace.h"
-#include "qapi/qmp/qerror.h"
#include "mfi.h"
@@ -2321,14 +2320,13 @@ static const struct SCSIBusInfo megasas_scsi_info = {
.cancel = megasas_command_cancel,
};
-static int megasas_scsi_init(PCIDevice *dev)
+static void megasas_scsi_realize(PCIDevice *dev, Error **errp)
{
DeviceState *d = DEVICE(dev);
MegasasState *s = MEGASAS(dev);
MegasasBaseClass *b = MEGASAS_DEVICE_GET_CLASS(s);
uint8_t *pci_conf;
int i, bar_type;
- Error *err = NULL;
pci_conf = dev->config;
@@ -2408,14 +2406,8 @@ static int megasas_scsi_init(PCIDevice *dev)
scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev),
&megasas_scsi_info, NULL);
if (!d->hotplugged) {
- scsi_bus_legacy_handle_cmdline(&s->bus, &err);
- if (err != NULL) {
- qerror_report_err(err);
- error_free(err);
- return -1;
- }
+ scsi_bus_legacy_handle_cmdline(&s->bus, errp);
}
- return 0;
}
static void
@@ -2509,7 +2501,7 @@ static void megasas_class_init(ObjectClass *oc, void *data)
MegasasBaseClass *e = MEGASAS_DEVICE_CLASS(oc);
const MegasasInfo *info = data;
- pc->init = megasas_scsi_init;
+ pc->realize = megasas_scsi_realize;
pc->exit = megasas_scsi_uninit;
pc->vendor_id = PCI_VENDOR_ID_LSI_LOGIC;
pc->device_id = info->device_id;