ahci: fix sysbus support
authorRob Herring <rob.herring@linaro.org>
Tue, 18 Mar 2014 19:36:13 +0000 (19:36 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 18 Mar 2014 19:36:13 +0000 (19:36 +0000)
commitbd16430777cc3d25930e479fdbe290d92cec0888
tree2225312457fded6f2ae78fc0d9949495a716b963
parent059b3527f0229f4d60fd77a317503d42abd5e50f
ahci: fix sysbus support

Non-PCI AHCI support is broken due to assertion failures when trying
to convert AHCIState to a PCIDevice pointer as AHCIState can have
different container structs. Fix this by using the non-asserting object
cast and checking the returned pointer is not NULL.

The AddressSpace pointer is also being initialized to NULL and causing
dma_memory_map call to fail. Fix this by initializing to
address_space_memory for sysbus instances.

Also correct AHCI_VMSTATE to use the correct container SysbusAHCIState
for sysbus instances.

Signed-off-by: Rob Herring <rob.herring@linaro.org>
Message-id: 1392073373-3295-1-git-send-email-robherring2@gmail.com
[PMM: added linebreaks to fix overlong lines]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/ide/ahci.c