Re: [libgpiod v2][PATCH 2/3] core: split chip_info out of chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 15, 2022 at 1:12 PM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx> 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@xxxxxxxxx>
> >
> > 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.
>

No, it's good. I like to idea of limiting the responsiblities of each structure.

Bart



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux