[v1,2/2] xilinx_spi: use qdev_init_gpio_out for gpio init
diff mbox series

Message ID 1522135274-15396-2-git-send-email-saipavanboddu@gmail.com
State New
Headers show
Series
  • Untitled series #36016
Related show

Commit Message

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

useful to connect gpio with qdev_connect_gpio_out

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/xilinx_spi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
index 83585bc..dcd1a2f 100644
--- a/hw/ssi/xilinx_spi.c
+++ b/hw/ssi/xilinx_spi.c
@@ -323,7 +323,6 @@  static int xilinx_spi_init(SysBusDevice *sbd)
 {
     DeviceState *dev = DEVICE(sbd);
     XilinxSPI *s = XILINX_SPI(dev);
-    int i;
 
     DB_PRINT("\n");
 
@@ -332,9 +331,7 @@  static int xilinx_spi_init(SysBusDevice *sbd)
     sysbus_init_irq(sbd, &s->irq);
     s->cs_lines = g_new0(qemu_irq, s->num_cs);
     ssi_auto_connect_slaves(dev, s->cs_lines, s->spi);
-    for (i = 0; i < s->num_cs; ++i) {
-        sysbus_init_irq(sbd, &s->cs_lines[i]);
-    }
+    qdev_init_gpio_out(dev, s->cs_lines, s->num_cs);
 
     memory_region_init_io(&s->mmio, OBJECT(s), &spi_ops, s,
                           "xilinx-spi", R_MAX * 4);