From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [libgpiod v2][PATCH 2/3] core: split chip_info out of chip
Date: Tue, 15 Mar 2022 20:12:11 +0800 [thread overview]
Message-ID: <20220315121211.GA174293@sol> (raw)
In-Reply-To: <CAMRc=Mf9pAWiKeR2GH6PQX=bUOvWXoyWUP2aY+5grzqoAn6M8A@mail.gmail.com>
On Tue, Mar 15, 2022 at 12:59:55PM +0100, Bartosz Golaszewski wrote:
> On Tue, Mar 15, 2022 at 6:32 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > The core library should be minimalist, only performing the operations
> > required, but gpiod_chip_open() always fetches the chip info,
> > even though the majority of the time the chip will only be used to
> > request a line, so the chip info is not required.
> >
> > Split the chip_info from the chip, in the same style as line_info, and
> > update methods and tools appropriately.
> >
> > In the rare occasions that the user requires the chip info they can
> > request it themselves using gpiod_chip_get_info(), as demonstrated
> > in the tool changes.
> >
> > Signed-off-by: Kent Gibson <warthog618@gmail.com>
>
> Ha! Interesting take. Makes sense. I queued this but tweaked a couple
> things (some bad copy-paste and stray newlines).
>
I've been flip-flopping on this one, but wanted to float it as we're
getting close to finalising the API.
In some ways hiding the chip info is simpler, and gpiod_chip_open()
already does a whole lot in gpiod_is_gpiochip_device(), so an extra
ioctl call isn't going to make much difference...
But it does reduce the gpiod_chip size a fair bit as well.
As I said - flip-flopping.
Cheers,
Kent.
next prev parent reply other threads:[~2022-03-15 12:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 5:32 [libgpiod v2][PATCH 0/3] api tweaks Kent Gibson
2022-03-15 5:32 ` [libgpiod v2][PATCH 1/3] core: rename gpiod_chip_info_event_wait and gpiod_chip_info_event_read Kent Gibson
2022-03-15 11:58 ` Bartosz Golaszewski
2022-03-15 5:32 ` [libgpiod v2][PATCH 2/3] core: split chip_info out of chip Kent Gibson
2022-03-15 11:59 ` Bartosz Golaszewski
2022-03-15 12:12 ` Kent Gibson [this message]
2022-03-15 12:15 ` Bartosz Golaszewski
2022-03-15 5:32 ` [libgpiod v2][PATCH 3/3] line-info: rename infobuf to uinfo Kent Gibson
2022-03-15 12:14 ` Bartosz Golaszewski
2022-03-15 12:24 ` 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=20220315121211.GA174293@sol \
--to=warthog618@gmail.com \
--cc=brgl@bgdev.pl \
--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).