From: Timur Tabi <timur@freescale.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Scott Wood <scottwood@freescale.com>,
linuxppc-dev@ozlabs.org, kumar.gala@freescale.com
Subject: Re: [PATCH] i2c-mpc: use the cell-index property to enumerate the I2C adapters
Date: Thu, 1 Dec 2011 15:59:34 -0600 [thread overview]
Message-ID: <4ED7F8C6.8060000@freescale.com> (raw)
In-Reply-To: <CACxGe6sZgG5q6NKgsGaWLyTzWHXNGqHke9nQMyqzw0audS3=tw@mail.gmail.com>
Grant Likely wrote:
> It is better to walk the list of i2c adapters and look for one that
> has the matching node pointer. It really isn't an expensive operation
> to do it that way.
That's what I was thinking. I can't figure out how to walk the list, though. i2c_get_adapter() takes an adapter number, but I don't think this is going to work:
unsigned int i = 0;
struct i2c_adapter adap = i2c_get_adapter(0);
while (adap) {
if (adap->nr == nr)
break;
adap = i2c_get_adapter(++i);
}
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2011-12-01 21:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 17:33 [PATCH] i2c-mpc: use the cell-index property to enumerate the I2C adapters Timur Tabi
2011-12-01 18:41 ` Scott Wood
2011-12-01 20:54 ` Timur Tabi
2011-12-01 21:29 ` Scott Wood
2011-12-01 21:46 ` Timur Tabi
2011-12-01 21:52 ` Scott Wood
2011-12-01 21:55 ` Grant Likely
2011-12-01 21:59 ` Timur Tabi [this message]
2011-12-01 21:59 ` Timur Tabi
2011-12-01 22:05 ` Scott Wood
2011-12-01 22:10 ` Timur Tabi
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=4ED7F8C6.8060000@freescale.com \
--to=timur@freescale.com \
--cc=grant.likely@secretlab.ca \
--cc=kumar.gala@freescale.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.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;
as well as URLs for NNTP newsgroup(s).