public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Kalle Pokki <kalle.pokki-loK5ZF7nR+A@public.gmane.org>
Cc: Bryan Wu <bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
	i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH] i2c-bfin-twi: Register adapter with a specific bus number
Date: Wed, 23 Jan 2008 14:26:34 +0100	[thread overview]
Message-ID: <20080123142634.2cc71cd2@hyperion.delvare> (raw)
In-Reply-To: <Pine.LNX.4.64.0801231047230.30599-er0LZAA46r2WwDxiJSwuDc1vFkv34tBQrE5yTffgRl4@public.gmane.org>

Hi Kalle,

On Wed, 23 Jan 2008 10:54:45 +0200 (EET), Kalle Pokki wrote:
> On Wed, 23 Jan 2008, Bryan Wu wrote:
> 
> > How do you think of following code, Kalle?
> > 
> > 	 /*
> >          * If "dev->id" is negative we consider it as zero.
> >          * The reason to do so is to avoid sysfs names that only make
> >          * sense when there are multiple adapters.
> >          */
> >         p_adap->nr = dev->id >= 0 ? dev->id : 0;
> > 
> > I found some i2c-gpio, i2c-ibm_iic.c and i2c-pxa.c using this code,
> > while others use your idea.
> 
> I don't see the point in ever defining dev->id as -1.

The point is spelled out just above:

"The reason to do so is to avoid sysfs names that only make sense when
there are multiple adapters."

I.e., some people prefer to have their platform device named just foo
instead of foo.0. Me, I wouldn't have bothered making an exception for
this, but the fact is that the platform core code supports it.

>                                                         None of the current 
> users of i2c-bfin-twi does that. Another option could be to use dynamic 
> bus numbers with dev->id == -1, but I think the only sane way to enumerate 
> this kind of SOC busses is to fix the numbers in the machine 
> initialization time.

I don't really care myself. I'll apply your patch as is, but if you
want to update it, that's equally fine.

-- 
Jean Delvare

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

  parent reply	other threads:[~2008-01-23 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-22 21:40 [PATCH] i2c-bfin-twi: Register adapter with a specific bus number Kalle Pokki
     [not found] ` <Pine.LNX.4.64.0801222335050.11948-er0LZAA46r2WwDxiJSwuDc1vFkv34tBQrE5yTffgRl4@public.gmane.org>
2008-01-23  7:56   ` Bryan Wu
2008-01-23  8:54     ` Kalle Pokki
     [not found]       ` <Pine.LNX.4.64.0801231047230.30599-er0LZAA46r2WwDxiJSwuDc1vFkv34tBQrE5yTffgRl4@public.gmane.org>
2008-01-23 13:26         ` Jean Delvare [this message]
     [not found]           ` <20080123142634.2cc71cd2-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-01-24 10:55             ` Kalle Pokki

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=20080123142634.2cc71cd2@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=bryan.wu-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=kalle.pokki-loK5ZF7nR+A@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