From: "Brigham Campbell" <me@brighamcampbell.com>
To: "Gero Schwäricke" <gero.schwaericke@sevenlab.de>,
"Brigham Campbell" <me@brighamcampbell.com>
Cc: "Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Jean Delvare" <jdelvare@suse.de>, <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH v2] i2c-tools: Allow passing device file paths
Date: Wed, 27 May 2026 00:09:40 -0600 [thread overview]
Message-ID: <DIT8HHYY12ME.3IGXT8OU1CGZ8@brighamcampbell.com> (raw)
In-Reply-To: <DI4RFLES1MXN.31HXMQMGXAXF7@sevenlab.de>
Hi Gero,
On Tue Apr 28, 2026 at 5:43 AM MDT, Gero Schwäricke wrote:
> I see that you're struggling to find a good way to pass the device
> information between lookup_i2c_bus() and open_i2c_dev(). How about we
> lookup and open the device in one go? Exit paths will have to close the
> file, but the rest should stay the same. It's worth to take a look at
> how libgpio does the same, see gpiod_chip_open_lookup().
I had worried that doing the device path lookup and opening in one go
would be overly invasive. Of course, if I can make that work, then it
would address the concerns that I brought up in my previous email. It
may be worth the extra effort to avoid the ugly variant struct I
introduced in this v2.
I'll take a look at libgpio. Thanks.
> Also, to keep things backward compatible, we should presumably do the
> path lookup only after bus number parsing and bus name lookup failed.
This makes sense. In the strange (but totally plausible) case of
conflicts between bus number, bus name, and bus file/symlink path, the
order of precedence should be as follows to maintain backwards
compatibility:
bus number -> bus name -> bus device path
I'll fix this in the next revision.
> Symlink support would be welcome as well.
As a matter of fact, this patch already supports symlinks. Passing
symlinks generated by udev to i2c{get,set} is the use case I'd like this
patch to support.
Thanks,
Brigham
next prev parent reply other threads:[~2026-05-27 6:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 8:18 [PATCH v2] i2c-tools: Allow passing device file paths Brigham Campbell
2026-04-01 23:33 ` Brigham Campbell
2026-04-28 11:43 ` Gero Schwäricke
2026-05-27 6:09 ` Brigham Campbell [this message]
2026-05-29 19:58 ` Wolfram Sang
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=DIT8HHYY12ME.3IGXT8OU1CGZ8@brighamcampbell.com \
--to=me@brighamcampbell.com \
--cc=gero.schwaericke@sevenlab.de \
--cc=jdelvare@suse.de \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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