diff mbox series

[2/4] hw/gpio/pca9552: Fix @type of pca9552 property led<N>

Message ID 20261104064552.959862-3-armbru@redhat.com
State New
Headers show
Series qom/qdev: associate properties with QAPI types fixups | expand

Commit Message

Markus Armbruster Nov. 4, 2026, 6:45 a.m. UTC
pca955x_initfn() passes @type "bool" to object_property_add().  The
properties are actually string-typed: pca955x_get_led() and
pca955x_set_led() use visit_type_str().  Pass "str" instead.

Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/gpio/pca9552.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Nov. 4, 2026, 11:12 a.m. UTC | #1
On 4/11/26 07:45, Markus Armbruster wrote:
> pca955x_initfn() passes @type "bool" to object_property_add().  The
> properties are actually string-typed: pca955x_get_led() and
> pca955x_set_led() use visit_type_str().  Pass "str" instead.
> 
> Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get")
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   hw/gpio/pca9552.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Miles Glenn Nov. 4, 2026, 10:05 p.m. UTC | #2
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>

Thanks,

Glenn

On Wed, 2026-11-04 at 07:45 +0100, Markus Armbruster wrote:
> pca955x_initfn() passes @type "bool" to object_property_add().  The
> properties are actually string-typed: pca955x_get_led() and
> pca955x_set_led() use visit_type_str().  Pass "str" instead.
> 
> Fixes: a90d8f84674d ("misc/pca9552: Add qom set and get")
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/gpio/pca9552.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c
> index 7e5fda4980..07ef0fb20b 100644
> --- a/hw/gpio/pca9552.c
> +++ b/hw/gpio/pca9552.c
> @@ -567,7 +567,7 @@ static void pca955x_initfn(Object *obj)
>          if (k->has_led_support) {
>              /* LED variant: expose the LED selector state as led%d. */
>              name = g_strdup_printf("led%d", ix);
> -            object_property_add(obj, name, "bool", NULL,
> +            object_property_add(obj, name, "str", NULL,
>                                  pca955x_get_led, pca955x_set_led, NULL, NULL);
>          } else {
>              /* GPIO variant: expose the pin logic level as pin%d. */
diff mbox series

Patch

diff --git a/hw/gpio/pca9552.c b/hw/gpio/pca9552.c
index 7e5fda4980..07ef0fb20b 100644
--- a/hw/gpio/pca9552.c
+++ b/hw/gpio/pca9552.c
@@ -567,7 +567,7 @@  static void pca955x_initfn(Object *obj)
         if (k->has_led_support) {
             /* LED variant: expose the LED selector state as led%d. */
             name = g_strdup_printf("led%d", ix);
-            object_property_add(obj, name, "bool", NULL,
+            object_property_add(obj, name, "str", NULL,
                                 pca955x_get_led, pca955x_set_led, NULL, NULL);
         } else {
             /* GPIO variant: expose the pin logic level as pin%d. */