[v1,1/2] ssi.c: Check if slave already attached to a parent bus
diff mbox series

Message ID 1522135274-15396-1-git-send-email-saipavanboddu@gmail.com
State New
Headers show
Series
  • [v1,1/2] ssi.c: Check if slave already attached to a parent bus
Related show

Commit Message

saipavanboddu@gmail.com March 27, 2018, 7:21 a.m. UTC
From: Sai Pavan Boddu <saipava@xilinx.com>

Skip auto-connect if already connected to a bus

Signed-off-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 hw/ssi/ssi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/hw/ssi/ssi.c b/hw/ssi/ssi.c
index 7eaaf56..6953c92 100644
--- a/hw/ssi/ssi.c
+++ b/hw/ssi/ssi.c
@@ -152,7 +152,7 @@  static int ssi_auto_connect_slave(Object *child, void *opaque)
     SSISlave *dev = (SSISlave *)object_dynamic_cast(child, TYPE_SSI_SLAVE);
     qemu_irq cs_line;
 
-    if (!dev) {
+    if (!dev || qdev_get_parent_bus(DEVICE(dev))) {
         return 0;
     }