Received: from eggs.gnu.org ([2001:4830:134:3::10]:45188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfALF-0003SW-Ji for qemu-devel@nongnu.org; Fri, 17 Oct 2014 12:25:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfALA-0004dW-Kz for qemu-devel@nongnu.org; Fri, 17 Oct 2014 12:25:25 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:39949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfALA-0004dJ-FI for qemu-devel@nongnu.org; Fri, 17 Oct 2014 12:25:20 -0400 Received: by mail-wi0-f176.google.com with SMTP id hi2so2515454wib.15 for ; Fri, 17 Oct 2014 09:25:19 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 17 Oct 2014 18:24:53 +0200 Message-Id: <1413563095-27301-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1413563095-27301-1-git-send-email-pbonzini@redhat.com> References: <1413563095-27301-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH qom v4 11/13] qdev: gpio: Remove qdev_init_gpio_out x1 restriction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , afaerber@suse.de, agraf@suse.de From: Peter Crosthwaite Previously this was restricted to a single call per-dev/per-name. With the conversion of the GPIO output state to QOM the implementation can now handle repeated calls. Remove the restriction. Reviewed-by: Alexander Graf Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/core/qdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 8550486..c143cd0 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -367,8 +367,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, char *propname = g_strdup_printf("%s[*]", name ? name : "unnamed-gpio-out"); assert(gpio_list->num_in == 0 || !name); - assert(gpio_list->num_out == 0); - gpio_list->num_out = n; + gpio_list->num_out += n; for (i = 0; i < n; ++i) { memset(&pins[i], 0, sizeof(*pins)); -- 2.1.0