All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Karol Lewandowski <k.lewandowsk-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: "w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org"
	<w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	"hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org"
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Rade Bozic <rade.bozic.ext-OYasijW0DpE@public.gmane.org>,
	"ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org"
	<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
	"khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org"
	<khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	"linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org"
	<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	"m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org"
	<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	"kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org"
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	"Daney,
	David"
	<David.Daney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
Subject: Re: [PATCH 2/2] i2c: Dynamically assign adapter id if it wasn't explictly specified
Date: Thu, 22 Mar 2012 11:07:35 -0700	[thread overview]
Message-ID: <4F6B6A67.7040905@gmail.com> (raw)
In-Reply-To: <4F6B65D0.1030506-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

On 03/22/2012 10:48 AM, Karol Lewandowski wrote:
> On 22.03.2012 17:58, David Daney wrote:
>
[...]

>>>> diff --git a/drivers/i2c/busses/i2c-octeon.c
>>>> b/drivers/i2c/busses/i2c-octeon.c
>>>> index ee139a5..8470232 100644
>>>> --- a/drivers/i2c/busses/i2c-octeon.c
>>>> +++ b/drivers/i2c/busses/i2c-octeon.c
>>>> @@ -581,7 +581,7 @@ static int __devinit octeon_i2c_probe(struct
>>>> platform_device *pdev)
>>>>
>>>>        i2c->adap = octeon_i2c_ops;
>>>>        i2c->adap.dev.parent =&pdev->dev;
>>>> -    i2c->adap.nr = pdev->id>= 0 ? pdev->id : 0;
>>>> +    i2c->adap.nr = pdev->id;
>>
>> I guess the OCTEON bit seems sane enough.  I don't fully understand why
>> this needs changing, because OCTEON platform code always passes a
>> non-negative pdev->id.
>
>
> i2c controllers instantiated from device tree seem to have -1 as id.
> Thus, trying to register more than one controller will fail as both
> will try to register on bus 0.
>
> However, I've just found that you got rid of this line altogether and
> switched to dynamic id allocation (i2c_add_adapter() instead of
> _numbered_ variant) in "MIPS: Octeon: Use Device Tree." RFC.
> Found here:
>
>    http://thread.gmane.org/gmane.linux.kernel/1104062
>
> In the light of above my (octeon-)fixup becomes redundant.
>
> Shall I repost this patch without octeon changes or is ok anyway?

My preference would be to omit the OCTEON portion from your patch.  As 
you noted, I plan to blow all that code away in the very near future, 
and the patch is not needed for correctness as far as I can see.

David Daney


>
> Thanks!
>
>>   But since you asked for it:
>>
>> Acked-by: David Daney<david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>>

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney.cavm@gmail.com>
To: Karol Lewandowski <k.lewandowsk@samsung.com>
Cc: "w.sang@pengutronix.de" <w.sang@pengutronix.de>,
	"hskinnemoen@gmail.com" <hskinnemoen@gmail.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	Rade Bozic <rade.bozic.ext@nsn.com>,
	"ben-linux@fluff.org" <ben-linux@fluff.org>,
	"khali@linux-fr.org" <khali@linux-fr.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dirk.brandewie@gmail.com" <dirk.brandewie@gmail.com>,
	"bigeasy@linutronix.de" <bigeasy@linutronix.de>,
	"m.szyprowski@samsung.com" <m.szyprowski@samsung.com>,
	"grant.likely@secretlab.ca" <grant.likely@secretlab.ca>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"Daney, David" <David.Daney@caviumnetworks.com>
Subject: Re: [PATCH 2/2] i2c: Dynamically assign adapter id if it wasn't explictly specified
Date: Thu, 22 Mar 2012 11:07:35 -0700	[thread overview]
Message-ID: <4F6B6A67.7040905@gmail.com> (raw)
In-Reply-To: <4F6B65D0.1030506@samsung.com>

On 03/22/2012 10:48 AM, Karol Lewandowski wrote:
> On 22.03.2012 17:58, David Daney wrote:
>
[...]

>>>> diff --git a/drivers/i2c/busses/i2c-octeon.c
>>>> b/drivers/i2c/busses/i2c-octeon.c
>>>> index ee139a5..8470232 100644
>>>> --- a/drivers/i2c/busses/i2c-octeon.c
>>>> +++ b/drivers/i2c/busses/i2c-octeon.c
>>>> @@ -581,7 +581,7 @@ static int __devinit octeon_i2c_probe(struct
>>>> platform_device *pdev)
>>>>
>>>>        i2c->adap = octeon_i2c_ops;
>>>>        i2c->adap.dev.parent =&pdev->dev;
>>>> -    i2c->adap.nr = pdev->id>= 0 ? pdev->id : 0;
>>>> +    i2c->adap.nr = pdev->id;
>>
>> I guess the OCTEON bit seems sane enough.  I don't fully understand why
>> this needs changing, because OCTEON platform code always passes a
>> non-negative pdev->id.
>
>
> i2c controllers instantiated from device tree seem to have -1 as id.
> Thus, trying to register more than one controller will fail as both
> will try to register on bus 0.
>
> However, I've just found that you got rid of this line altogether and
> switched to dynamic id allocation (i2c_add_adapter() instead of
> _numbered_ variant) in "MIPS: Octeon: Use Device Tree." RFC.
> Found here:
>
>    http://thread.gmane.org/gmane.linux.kernel/1104062
>
> In the light of above my (octeon-)fixup becomes redundant.
>
> Shall I repost this patch without octeon changes or is ok anyway?

My preference would be to omit the OCTEON portion from your patch.  As 
you noted, I plan to blow all that code away in the very near future, 
and the patch is not needed for correctness as far as I can see.

David Daney


>
> Thanks!
>
>>   But since you asked for it:
>>
>> Acked-by: David Daney<david.daney@cavium.com>
>>

  parent reply	other threads:[~2012-03-22 18:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 12:19 [PATCH 0/2] i2c: Don't assume bus nr 0 if none was specified Karol Lewandowski
     [not found] ` <1331900343-6743-1-git-send-email-k.lewandowsk-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-03-16 12:19   ` [PATCH 1/2] i2c-pxa: Drop leftover comment Karol Lewandowski
2012-03-16 12:19     ` Karol Lewandowski
2012-03-16 12:19   ` [PATCH 2/2] i2c: Dynamically assign adapter id if it wasn't explictly specified Karol Lewandowski
2012-03-16 12:19     ` Karol Lewandowski
2012-03-22 15:28     ` Karol Lewandowski
     [not found]       ` <4F6B4532.7090806-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-03-22 16:11         ` Russell King - ARM Linux
2012-03-22 16:11           ` Russell King - ARM Linux
2012-03-22 17:03           ` Karol Lewandowski
2012-03-22 16:58         ` David Daney
2012-03-22 16:58           ` David Daney
     [not found]           ` <4F6B5A22.1090204-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2012-03-22 17:48             ` Karol Lewandowski
2012-03-22 17:48               ` Karol Lewandowski
     [not found]               ` <4F6B65D0.1030506-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-03-22 18:07                 ` David Daney [this message]
2012-03-22 18:07                   ` David Daney
2012-03-22 21:47         ` Wolfram Sang
2012-03-22 21:47           ` Wolfram Sang
     [not found]           ` <20120322214714.GA24684-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-26  9:14             ` Karol Lewandowski
2012-03-26  9:14               ` Karol Lewandowski
2012-03-16 12:27   ` [PATCH 0/2] i2c: Don't assume bus nr 0 if none was specified Karol Lewandowski
2012-03-16 12:27     ` Karol Lewandowski
     [not found]     ` <4F6331AF.3010007-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2012-03-17 10:50       ` Grant Likely
2012-03-17 10:50         ` Grant Likely
  -- strict thread matches above, loose matches on Subject: below --
2012-03-27  9:10 [PATCH v2 " Karol Lewandowski
2012-03-27  9:10 ` [PATCH 2/2] i2c: Dynamically assign adapter id if it wasn't explictly specified Karol Lewandowski

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=4F6B6A67.7040905@gmail.com \
    --to=ddaney.cavm-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=David.Daney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=hskinnemoen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=k.lewandowsk-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=rade.bozic.ext-OYasijW0DpE@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.