From: Kent Gibson <warthog618@gmail.com>
To: Chuang Zhu <chuang+git@melty.land>
Cc: linux-gpio@vger.kernel.org, Chuang Zhu <git@chuang.cz>
Subject: Re: [libgpiod][PATCH v2 2/2] bindings: python: fix line request by name with multiple entries
Date: Fri, 28 Jun 2024 18:44:02 +0800 [thread overview]
Message-ID: <20240628104402.GA57270@rigel> (raw)
In-Reply-To: <20240627153103.594107-2-chuang+git@melty.land>
On Thu, Jun 27, 2024 at 11:31:03PM +0800, Chuang Zhu wrote:
> From: Chuang Zhu <git@chuang.cz>
>
> When multiple entries are requested using line names in
> Chip.request_lines, only the the last entry is added to
> LineRequest._name_map, causing a ValueError when trying to use functions
> like LineRequest.set_value on any former entries.
>
Chip.request_lines()
> This patch fixes that by moving the required variables to the correct
> scope.
>
Use imperitive, "Move the required...."
> Signed-off-by: Chuang Zhu <git@chuang.cz>
Use the same address to sign off and send the submission email.
With a multi-patch series you should include a cover letter that
describes the series the changes between versions.
e.g. here you have fixed my review comments, but also fixed not moving the
offsets list into the outer scope.
Cheers,
Kent.
> ---
> bindings/python/gpiod/chip.py | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/bindings/python/gpiod/chip.py b/bindings/python/gpiod/chip.py
> index 19c62cd..55f0c3e 100644
> --- a/bindings/python/gpiod/chip.py
> +++ b/bindings/python/gpiod/chip.py
> @@ -279,11 +279,12 @@ class Chip:
> else:
> mapped_output_values = None
>
> + name_map = dict()
> + offset_map = dict()
> + global_output_values = list()
> +
> for lines, settings in config.items():
> offsets = list()
> - name_map = dict()
> - offset_map = dict()
> - global_output_values = list()
>
> if isinstance(lines, int) or isinstance(lines, str):
> lines = (lines,)
> --
> 2.44.0
>
next prev parent reply other threads:[~2024-06-28 10:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-27 15:31 [libgpiod][PATCH v2 1/2] bindings: python: tests: add a test case for line request by name with multiple entries Chuang Zhu
2024-06-27 15:31 ` [libgpiod][PATCH v2 2/2] bindings: python: fix " Chuang Zhu
2024-06-28 10:44 ` Kent Gibson [this message]
2024-06-28 10:31 ` [libgpiod][PATCH v2 1/2] bindings: python: tests: add a test case for " Kent Gibson
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=20240628104402.GA57270@rigel \
--to=warthog618@gmail.com \
--cc=chuang+git@melty.land \
--cc=git@chuang.cz \
--cc=linux-gpio@vger.kernel.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).