public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: plagnioj@jcrosoft•com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] i2c: i2c-gpio: fix issue when DT node greater than 1
Date: Mon, 15 Oct 2012 07:55:30 +0200	[thread overview]
Message-ID: <20121015055530.GP12801@game.jcrosoft.org> (raw)
In-Reply-To: <507B7C07.3070702@atmel.com>

On 10:59 Mon 15 Oct     , Bo Shen wrote:
> Hi Jean Delvare,
> 
> On 10/10/2012 10:54, Bo Shen wrote:
> >
> >Hi Jean Delvare,
> >
> >On 9/19/2012 23:54, Jean Delvare wrote:
> >>On Wed, 19 Sep 2012 09:28:04 -0600, Stephen Warren wrote:
> >>>On 09/18/2012 07:15 PM, Bo Shen wrote:
> >>>>I add the debug info, and it give the following error without this
> >>>>patch.
> >>>>
> >>>>--<8----------------------------------
> >>>>adap->name = i2c-gpio-1
> >>>>i2c-gpio i2c.2: using pins 30 (SDA) and 31 (SCL)
> >>>>adap->name = i2c-gpio-1
> >>>>i2c-gpio: probe of i2c.3 failed with error -16
> >>>>-->8----------------------------------
> >>>>
> >>>>With this patch, it successfully registered.
> >>>>--<8----------------------------------
> >>>>adap->name = i2c-gpio0
> >>>>i2c-gpio i2c.2: using pins 30 (SDA) and 31 (SCL)
> >>>>adap->name = i2c-gpio1
> >>>>i2c-gpio i2c.3: using pins 90 (SDA) and 91 (SCL)
> >>>>-->8----------------------------------
> >>>
> >>>Yes, that explains why the registration fails, but not why this patch is
> >>>the correct solution to the problem.
> >>>
> >>>The problematic code appears to be:
> >>>
> >>>snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id);
> >>>
> >>>Instead, I think that should be something more like:
> >>>
> >>>adap->name = dev_name(&pdev->dev);
> >>
> >>strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name))
> >> if anything, as adap->name is a buffer, not a pointer.
> >
> >I am sorry for late. I have tested with DT, it works.
> >
> >Please send this patch to fix the issue.
> >Thanks.
> 
> Ping?
> 
> Will you send this patch? Or, I send this patch and add your S.O.B,
> which do you prefer?

do it

Best Regards,
J.

  reply	other threads:[~2012-10-15  5:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  9:02 [PATCH] i2c: i2c-gpio: fix issue when DT node greater than 1 Bo Shen
2012-09-18 14:51 ` Stephen Warren
2012-09-19  1:15   ` Bo Shen
2012-09-19 15:28     ` Stephen Warren
2012-09-19 15:54       ` Jean Delvare
2012-10-10  2:54         ` Bo Shen
2012-10-15  2:59           ` Bo Shen
2012-10-15  5:55             ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-10-15  6:49             ` Jean Delvare
2012-10-15  7:32               ` Bo Shen

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=20121015055530.GP12801@game.jcrosoft.org \
    --to=plagnioj@jcrosoft$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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