public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	linuxppc-dev list
	<Linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	Linux-cy1Wll9GaHOsTnJN9+BGXg@public.gmane.org,
	Timur Tabi <timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
	I2C <i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org>
Subject: Re: [PATCH] Convert i2c-mpc from a platform driver to an of_platform one
Date: Sun, 29 Jun 2008 09:17:25 +0200	[thread overview]
Message-ID: <20080629091725.291974e9@hyperion.delvare> (raw)
In-Reply-To: <20080629065812.GO13876-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>

On Sun, 29 Jun 2008 00:58:12 -0600, Grant Likely wrote:
> On Sun, Jun 29, 2008 at 08:31:43AM +0200, Jean Delvare wrote:
> > Hi Jon, Grant,
> > 
> > On Sat, 28 Jun 2008 22:49:40 -0600, Grant Likely wrote:
> > > On Sat, Jun 28, 2008 at 10:05:28PM -0400, Jon Smirl wrote:
> > > > >
> > > > > The driver was previously using i2c_add_numbered_adapter(), giving MPC
> > > > >  platform the possibility to use new-style i2c drivers:
> > > > >  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1469fa263870acd890a4b9f6ef557acc5d673b44
> > > > >  You're breaking this, I doubt it's on purpose?
> > > > 
> > > > Grant, what do you want here? You're the one who converted it to
> > > > i2c_add_numbered_adapter. But in other posts you've said that the
> > > > device tree should have nothing to do with bus numbering.
> > > 
> > > Yes, I did make that change, but that was when it was a platform bus
> > > driver.  Converting it to an of_platform bus driver entirely changes the
> > > situation and it should go back to using i2c_add_adapter() with a parse
> > > of the device tree for child nodes.
> > 
> > I am surprised and disappointed, as this sounds like a regression.
> > Registering the i2c buses with random numbers and parsing the device
> > tree later to figure out which devices are where, is what everybody was
> > doing before the new i2c device/driver matching model was implemented,
> > because there was no other way. I'm curious why you are going back to
> > this approach when i2c-core now offers something way cleaner and more
> > efficient.
> 
> Ah, but the whole random number parsing thing is no longer necessary
> because we ensure that registration of i2c devices always occurs
> after the i2c adapter is created (for device tree aware i2c adapter
> drivers.  adapters that aren't device tree aware still need to assign a
> number).
> 
> After the i2c adapter registers itself, of_register_i2c_devices() is called
> which walks through the child nodes of the i2c adapter node in the device
> tree.  Each child node is an i2c device, and it immediately get
> registered with the adapter.  Because this ensures that i2c device
> registration always happens after adapter registration, and since the
> pointer to the i2c_adapter is known, then i2c_new_device() can be used
> directly without ever needing to know the bus number.

Ah, OK. If you use i2c_new_device() then it's alright.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-06-29  7:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11  2:40 [PATCH] Convert i2c-mpc from a platform driver to an of_platform one Jon Smirl
2008-06-11 16:00 ` [i2c] " Wolfram Sang
2008-06-11 16:14   ` Jon Smirl
2008-06-25 13:25     ` Jean Delvare
2008-06-25 13:58 ` Jean Delvare
2008-06-29  2:05   ` Jon Smirl
2008-06-29  4:49     ` Grant Likely
2008-06-29  6:31       ` Jean Delvare
2008-06-29  6:58         ` Grant Likely
     [not found]           ` <20080629065812.GO13876-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
2008-06-29  7:17             ` Jean Delvare [this message]
2008-06-29 16:24               ` Sean MacLennan
2008-06-29 16:35                 ` Jean Delvare
2008-06-30  2:51               ` David Brownell
2008-06-29  4:57 ` Grant Likely

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=20080629091725.291974e9@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=Linux-cy1Wll9GaHOsTnJN9+BGXg@public.gmane.org \
    --cc=Linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    /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