From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] drivers/spi/spi.c: when allocating a struct device_d specify id as -1
Date: Mon, 14 May 2012 11:05:31 +0200 [thread overview]
Message-ID: <20120514090531.GE30400@pengutronix.de> (raw)
In-Reply-To: <1336984719-10670-1-git-send-email-jlu@pengutronix.de>
On Mon, May 14, 2012 at 10:38:39AM +0200, Jan Luebbe wrote:
> This causes allocation of a free id and avoids conflicts if multiple
> identical SPI devices are attached.
>
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> ---
> drivers/spi/spi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 7a8aed4..b63d02f 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -78,6 +78,7 @@ struct spi_device *spi_new_device(struct spi_master *master,
> proxy->bits_per_word = chip->bits_per_word ? chip->bits_per_word : 8;
> proxy->dev.platform_data = chip->platform_data;
> strcpy(proxy->dev.name, chip->name);
> + proxy->dev.id = -1; /* allocate a free id for this chip */
Please use DEVICE_ID_DYNAMIC instead.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-05-14 9:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-14 8:38 Jan Luebbe
2012-05-14 9:05 ` Sascha Hauer [this message]
2012-05-14 10:43 ` [PATCH v2] drivers/spi/spi.c: use DEVICE_ID_DYNAMIC when allocating a struct device_d Jan Luebbe
2012-05-14 17:47 ` Sascha Hauer
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=20120514090531.GE30400@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jlu@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