linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefan Roese <sr@denx.de>
Cc: Jean Delvare <khali@linux-fr.org>,
	linuxppc-dev@ozlabs.org, i2c@lm-sensors.org
Subject: Re: [PATCH] i2c: devtree-aware iic support for PPC4xx
Date: Mon, 17 Sep 2007 15:50:01 +1000	[thread overview]
Message-ID: <20070917055001.GB9303@localhost.localdomain> (raw)
In-Reply-To: <200709170734.09079.sr@denx.de>

On Mon, Sep 17, 2007 at 07:34:08AM +0200, Stefan Roese wrote:
> On Sunday 16 September 2007, Eugene Surovegin wrote:
> > Hmm, I just noticed that you basically added a copy of existing
> > driver with small changes to support OF while keeping OCP one.
> >
> > Why not just add OF support to the existing code (under some ifdef),
> > and then remove OCP support as soon as ppc -> powerpc transition is
> > finished? Why have two almost identical code in the tree?
> 
> My understanding was, that adding many #ifdef's into the code was not the 
> preferred way. I could of course change this patch to not add an additional 
> driver but extend the existing driver with a bunch of #ifdef's to support 
> both versions.

#ifdefs are yucky, but so is duplication.  I'm not sure which is the
lesser evil in this case.

> This approach of multiple drivers seems to be common in the kernel right now:
> 
> drivers/mtd/maps/physmap.c
> drivers/mtd/maps/physmap_of.c

Not a relevant example.  Despite the names, physmap and physmap_of
don't really do the same thing at all.  I've been meaning to rename
physmap_of...

> 
> or
> 
> drivers/usb/host/ohci-ppc-soc.c
> drivers/usb/host/ohci-ppc-of.c

Also ibm_emac vs. ibm_new_emac (not merged yet).

> Any other opinions on this? How should this be handled to get accepted 
> upstream? Two different drivers with removing the "old" one later when 
> arch/ppc is gone, or one driver which supports both versions and removing the 
> ocp support in this driver later?
> 
> > I also personally don't like this _iic -> _of name change (you
> > removed peripheral name and added something which has nothing to do
> > with iic, I never heard of OF peripheral in 4xx chips). Whether you
> > use OCP or OF to pass a little information is quite irrelevant to the
> > iic driver operation.
> 
> The "old" name "i2c-ibm_iic" is kind of redundant. Nearly all bus drivers are 
> named "i2c-platform". Perhaps a better name would be "i2c-ppc4xx" then. 
> This "of" name was borrowed from already existing device-tree aware drivers 
> like drivers/mtd/maps/physmap_of.c or drivers/usb/host/ohci-ppc-of.c.

'ibm' is not specific enough - it's not like it's used on even a very
large fraction of ibm platforms - and 'of' is verging on misleading
(since OF != device tree, although they're related).  'iic' isn't
arbitrary - it comes from the name used in the documentation.
Although 'i2c-ppc4xx' probably is a better name, in any case.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

  reply	other threads:[~2007-09-17  5:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-16 11:52 [PATCH] i2c: devtree-aware iic support for PPC4xx Stefan Roese
2007-09-16 16:27 ` Robert Schwebel
2007-09-16 16:37   ` Josh Boyer
2007-09-17  1:32   ` David Gibson
2007-09-16 18:53 ` Eugene Surovegin
2007-09-17  1:31   ` David Gibson
2007-09-17  5:34   ` Stefan Roese
2007-09-17  5:50     ` David Gibson [this message]
2007-09-17  6:22     ` Eugene Surovegin
2007-09-17 18:16     ` Jean Delvare
2007-09-17 19:27     ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2007-09-15  9:08 Stefan Roese
2007-09-15 10:04 ` Eugene Surovegin
2007-09-15 11:29   ` Vitaly Bordug
2007-09-16  9:07     ` Stefan Roese
2007-09-16 18:55       ` Eugene Surovegin
2007-09-15 11:36 ` Stephen Rothwell
2007-09-16  9:08   ` Stefan Roese

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=20070917055001.GB9303@localhost.localdomain \
    --to=david@gibson.dropbear.id.au \
    --cc=i2c@lm-sensors.org \
    --cc=khali@linux-fr.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=sr@denx.de \
    /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).