From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH8F6-0002Qs-4h for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XH8Ez-0003cc-Tb for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:19:44 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39582 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XH8Ez-0003cY-MT for qemu-devel@nongnu.org; Tue, 12 Aug 2014 05:19:37 -0400 Message-ID: <53E9DC28.9050105@suse.de> Date: Tue, 12 Aug 2014 11:19:36 +0200 From: Alexander Graf MIME-Version: 1.0 References: <8482219871810d095f8b6e497902b4b48f69b108.1407116648.git.peter.crosthwaite@xilinx.com> In-Reply-To: <8482219871810d095f8b6e497902b4b48f69b108.1407116648.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 12/16] qdev: gpio: Remove qdev_init_gpio_out x1 restriction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, afaerber@suse.de, pbonzini@redhat.com On 04.08.14 03:58, Peter Crosthwaite wrote: > 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. > > Signed-off-by: Peter Crosthwaite > --- > > 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 77b0b09..bf2c227 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -366,8 +366,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, Maybe rename it to _add rather than _init then? Alex > NamedGPIOList *gpio_list = qdev_get_named_gpio_list(dev, name); > > assert(gpio_list->num_in == 0 || !name); > - assert(gpio_list->num_out == 0); > - gpio_list->num_out = n; > + gpio_list->num_out += n; > > char *propname = g_strdup_printf("%s[*]", name ? name : "unnamed-gpio-out"); > for (i = 0; i < n; ++i) {