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

Thierry Reding thierry.reding at avionic-design.de
Thu Apr 26 02:39:37 EST 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.ozlabs.org/pipermail/devicetree-discuss/attachments/20120425/ae82b75a/attachment.sig>


More information about the devicetree-discuss mailing list