From: Jean Delvare <khali@linux-fr.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>,
linux-kernel@vger.kernel.org, i2c@lm-sensors.org
Subject: Re: [PATCH] i2c-gpio: Add support for new-style clients
Date: Thu, 14 Jun 2007 08:24:17 +0200 [thread overview]
Message-ID: <20070614082417.4be74afc@hyperion.delvare> (raw)
In-Reply-To: <20070613.004316.128619812.anemo@mba.ocn.ne.jp>
Hi Atsushi,
On Wed, 13 Jun 2007 00:43:16 +0900 (JST), Atsushi Nemoto wrote:
> Use i2c_bit_add_numbered_bus() if device id specified, so that the
> i2c-gpio adapter works well with new-style pre-declared devices.
>
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
> ---
> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> index a7dd546..8a62c26 100644
> --- a/drivers/i2c/busses/i2c-gpio.c
> +++ b/drivers/i2c/busses/i2c-gpio.c
> @@ -142,7 +142,10 @@ static int __init i2c_gpio_probe(struct platform_device *pdev)
> adap->algo_data = bit_data;
> adap->dev.parent = &pdev->dev;
>
> - ret = i2c_bit_add_bus(adap);
> + if (pdev->id == -1)
> + ret = i2c_bit_add_bus(adap);
> + else
> + ret = i2c_bit_add_numbered_bus(adap);
> if (ret)
> goto err_add_bus;
>
This isn't sufficient. Before you call i2c_bit_add_numbered_bus(adap),
you are supposed to set adap->nr to the desired i2c adapter number.
--
Jean Delvare
next prev parent reply other threads:[~2007-06-14 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-12 15:43 Atsushi Nemoto
2007-06-13 11:15 ` Haavard Skinnemoen
2007-06-14 6:24 ` Jean Delvare [this message]
2007-06-14 6:40 ` Atsushi Nemoto
2007-06-15 15:59 ` Jean Delvare
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=20070614082417.4be74afc@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=hskinnemoen@atmel.com \
--cc=i2c@lm-sensors.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®