[RFC v2 3/5] i2c: Add of_i2c_get_adapter() function

Thierry Reding thierry.reding at avionic-design.de
Wed Apr 25 09:39:37 PDT 2012


* Stephen Warren wrote:
> On 04/25/2012 03:45 AM, Thierry Reding wrote:
> > This function resolves an OF device node to an I2C adapter registered
> > with the I2C core.
> 
> I think this is doing the same thing as a patch I posted recently:
> http://www.spinics.net/lists/linux-i2c/msg07808.html

I wasn't aware of that patch.

> What's the advantage of one way over the other?

Both are fine I think. Your version is shorter but mine may be a little
faster since it doesn't iterate over all devices on the bus. Since the
lookup doesn't happen very frequently this isn't much of an issue.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20120425/ae82b75a/attachment.pgp>


More information about the dri-devel mailing list