From: Peter Maydell <peter.maydell@linaro.org>
To: Glenn Miles <milesg@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org, clg@kaod.org,
andrew@codeconstruct.com.au, joel@jms.id.au, philmd@linaro.org
Subject: Re: [PATCH v2 RESEND] misc/led: LED state is set opposite of what is expected
Date: Wed, 25 Oct 2023 13:59:25 +0100 [thread overview]
Message-ID: <CAFEAcA-9mPtVWfpx=fbALZEaOPX6b5aEAtcRgDCpzfH4keLEcQ@mail.gmail.com> (raw)
In-Reply-To: <20231024191945.4135036-1-milesg@linux.vnet.ibm.com>
On Tue, 24 Oct 2023 at 20:20, Glenn Miles <milesg@linux.vnet.ibm.com> wrote:
>
> Testing of the LED state showed that when the LED polarity was
> set to GPIO_POLARITY_ACTIVE_LOW and a low logic value was set on
> the input GPIO of the LED, the LED was being turn off when it was
> expected to be turned on.
>
> Signed-off-by: Glenn Miles <milesg@linux.vnet.ibm.com>
> ---
>
> Changes from v1:
> - Changed logic for readability
>
> hw/misc/led.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/misc/led.c b/hw/misc/led.c
> index f6d6d68bce..42bb43a39a 100644
> --- a/hw/misc/led.c
> +++ b/hw/misc/led.c
> @@ -63,7 +63,7 @@ static void led_set_state_gpio_handler(void *opaque, int line, int new_state)
> LEDState *s = LED(opaque);
>
> assert(line == 0);
> - led_set_state(s, !!new_state != s->gpio_active_high);
> + led_set_state(s, !!new_state == s->gpio_active_high);
> }
>
> static void led_reset(DeviceState *dev)
> --
> 2.31.1
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
next prev parent reply other threads:[~2023-10-25 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 19:19 [PATCH v2 RESEND] misc/led: LED state is set opposite of what is expected Glenn Miles
2023-10-25 12:59 ` Peter Maydell [this message]
2023-10-27 11:51 ` Peter Maydell
2023-10-27 13:33 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFEAcA-9mPtVWfpx=fbALZEaOPX6b5aEAtcRgDCpzfH4keLEcQ@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=milesg@linux.vnet.ibm.com \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).