From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [SPAM] [PATCH 3/5] i2c: Add support for dynamic i2c bus numbers
Date: Tue, 21 May 2013 08:49:49 +0200 [thread overview]
Message-ID: <20130521064949.GJ32299@pengutronix.de> (raw)
In-Reply-To: <20130520222747.GB27130@game.jcrosoft.org>
On Tue, May 21, 2013 at 12:27:47AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 22:11 Mon 20 May , Sascha Hauer wrote:
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > ---
> > drivers/i2c/i2c.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
> > index 53a11fe..ddf0082 100644
> > --- a/drivers/i2c/i2c.c
> > +++ b/drivers/i2c/i2c.c
> > @@ -384,8 +384,17 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adapter)
> > {
> > int ret;
> >
> > - if (i2c_get_adapter(adapter->nr))
> > - return -EBUSY;
> > + if (adapter->nr < 0) {
> > + int nr;
> > +
> > + for (nr = 0;; nr++)
> > + if (!i2c_get_adapter(nr))
> > + break;
> > + adapter->nr = nr;
> > + } else {
> > + if (i2c_get_adapter(adapter->nr))
> > + return -EBUSY;
> > + }
>
> I send a patch exactly the same on spi and you refuse it
The time you sent it we talked about platform devices and I still think
that it's not a good idea to register the SPI masters with dynamic bus
numbers and to have statically assigned numbers in the spi_board_info.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-05-21 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 20:11 Sascha Hauer
2013-05-20 20:11 ` [PATCH 1/5] i2c: Add missing result check Sascha Hauer
2013-05-20 20:11 ` [PATCH 2/5] i2c: remove dead code Sascha Hauer
2013-05-20 20:11 ` [PATCH 3/5] i2c: Add support for dynamic i2c bus numbers Sascha Hauer
2013-05-20 22:27 ` [SPAM] " Jean-Christophe PLAGNIOL-VILLARD
2013-05-21 6:49 ` Sascha Hauer [this message]
2013-05-20 20:11 ` [PATCH 4/5] i2c: Add devicetree support Sascha Hauer
2013-05-20 20:11 ` [PATCH 5/5] i2c: fsl: Add devicetree probe support Sascha Hauer
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=20130521064949.GJ32299@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=plagnioj@jcrosoft.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