public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Karol Lewandowski <k.lewandowsk@samsung.com>
To: w.sang@pengutronix.de
Cc: ben-linux@fluff.org, khali@linux-fr.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	hskinnemoen@gmail.com, dirk.brandewie@gmail.com,
	bigeasy@linutronix.de, m.szyprowski@samsung.com,
	grant.likely@secretlab.ca, kyungmin.park@samsung.com
Subject: Re: [PATCH 0/2] i2c: Don't assume bus nr 0 if none was specified
Date: Fri, 16 Mar 2012 13:27:27 +0100	[thread overview]
Message-ID: <4F6331AF.3010007@samsung.com> (raw)
In-Reply-To: <1331900343-6743-1-git-send-email-k.lewandowsk@samsung.com>

On 16.03.2012 13:19, Karol Lewandowski wrote:

> Hi,
> 
> i2c controller drivers used to assume bus number 0 when none (-1) was specified.
> 
> This worked on non-device tree systems, where one could explicitly specify
> bus number via platform data.  On DT-enabled systems bus number is always -1.
> 
> Some drivers assume bus number 0 when -1 is specified.  This patchset kills
> this logic and switches to dynamic bus allocation (default when -1 is provided[1]).


[ I must have lost actual problem description while rewording
  message itself... ]

Problem arises when multiple drivers (or multiple instances
of one driver) try to assume the same fixed bus number (0).

This causes simply causes i2c_add_numbered_bus() to fail.
Leaving -1 works perfectly, as registration function switches
to dynamic id registration.

> 
> [ I've found out this when I've tried to instantiate more than one i2c-gpio
>   instance on DT-enabled system. I've, hopefully, fixed few other drivers too. ]
> 
> [1] Introduced by Grant Likely in 488bf314b ("i2c: Allow i2c_add_numbered_adapter()
>     to assign a bus id")
> 
> Karol Lewandowski (2):
>   i2c-pxa: Drop leftover comment
>   i2c: Dynamically assign adapter id if it wasn't explictly specified
> 
>  drivers/i2c/busses/i2c-gpio.c         |    7 +------
>  drivers/i2c/busses/i2c-octeon.c       |    2 +-
>  drivers/i2c/busses/i2c-pca-platform.c |    2 +-
>  drivers/i2c/busses/i2c-pxa.c          |    5 -----
>  drivers/i2c/busses/i2c-versatile.c    |    9 ++-------
>  5 files changed, 5 insertions(+), 20 deletions(-)
> 



-- 
Karol Lewandowski | Samsung Poland R&D Center | Linux/Platform

  parent reply	other threads:[~2012-03-16 12:27 UTC|newest]

Thread overview: 13+ 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
2012-03-16 12:19 ` [PATCH 1/2] i2c-pxa: Drop leftover comment 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-22 15:28   ` Karol Lewandowski
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 17:48       ` Karol Lewandowski
2012-03-22 18:07         ` David Daney
2012-03-22 21:47     ` Wolfram Sang
2012-03-26  9:14       ` Karol Lewandowski
2012-03-16 12:27 ` Karol Lewandowski [this message]
2012-03-17 10:50   ` [PATCH 0/2] i2c: Don't assume bus nr 0 if none was specified 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=4F6331AF.3010007@samsung.com \
    --to=k.lewandowsk@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=bigeasy@linutronix.de \
    --cc=dirk.brandewie@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=hskinnemoen@gmail.com \
    --cc=khali@linux-fr.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=w.sang@pengutronix.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