[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 12/16] qdev: gpio: Remove qdev_init_gpio_out
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH v1 12/16] qdev: gpio: Remove qdev_init_gpio_out x1 restriction |
Date: |
Tue, 12 Aug 2014 20:35:58 +1000 |
On Tue, Aug 12, 2014 at 7:19 PM, Alexander Graf <address@hidden> wrote:
>
> 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 <address@hidden>
>> ---
>>
>> 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?
>
Hmmm that's a tree-wide (unless we allow the _named variant to have
inconsistent naming with the well used qdev_init_gpio_out). This
change does make the behaviour consistent with current
qdev_init_gpio_in behav where you are already allowed multiple calls:
qdev_init_gpio_in(dev, foo, ...);
qdev_init_gpio_in(dev, bar, ...);
Perhaps fix them both together with the tree wide as follow up?
Regards,
Peter
>
> 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) {
>
>
>
- [Qemu-devel] [PATCH v1 06/16] qom: Demote already-has-a-parent to a regular error, (continued)
- [Qemu-devel] [PATCH v1 06/16] qom: Demote already-has-a-parent to a regular error, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 07/16] qdev: gpio: Re-impement qdev_connect_gpio QOM style, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 08/16] qdev: gpio: Add API for intercepting an IRQ, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 09/16] qtest/irq: Rework IRQ interception, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 10/16] irq: Remove qemu_irq_intercept_out, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 11/16] qdev: gpio: delete NamedGPIOList::out, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 12/16] qdev: gpio: Remove qdev_init_gpio_out x1 restriction, Peter Crosthwaite, 2014/08/03
- [Qemu-devel] [PATCH v1 13/16] qdev: gpio: Define qdev_pass_gpios(), Peter Crosthwaite, 2014/08/03
[Qemu-devel] [PATCH v1 14/16] ssi: xilinx_spi: Initialise CS GPIOs as NULL, Peter Crosthwaite, 2014/08/03
[Qemu-devel] [PATCH v1 15/16] ppc: convert g_new(qemu_irq usages to g_new0, Peter Crosthwaite, 2014/08/03