From 5cd5e7015962d8d559afb5154888fd34a8526ddd Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 12 Feb 2015 21:39:20 +0100 Subject: pci: split shpc_cleanup and shpc_free object_unparent should not be called until the parent device is going to be destroyed. Only remove the capability and do memory_region_del_subregion at unrealize time. Freeing the data structures is left in shpc_free, to be called from the instance_finalize callback. Acked-by: Michael S. Tsirkin Reviewed-by: Matthew Rosato Reviewed-by: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- include/hw/pci/shpc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/hw/pci') diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h index 025bc5b..9bbea39 100644 --- a/include/hw/pci/shpc.h +++ b/include/hw/pci/shpc.h @@ -41,6 +41,7 @@ void shpc_reset(PCIDevice *d); int shpc_bar_size(PCIDevice *dev); int shpc_init(PCIDevice *dev, PCIBus *sec_bus, MemoryRegion *bar, unsigned off); void shpc_cleanup(PCIDevice *dev, MemoryRegion *bar); +void shpc_free(PCIDevice *dev); void shpc_cap_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int len); -- cgit v1.1