From: Grant Likely <grant.likely@secretlab.ca>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: spi-devel-general@lists.sourceforge.net,
David Brownell <dbrownell@users.sourceforge.net>,
linux-kernel@vger.kernel.org, Luotao Fu <l.fu@pengutronix.de>,
linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 3/3] [V2] mpc52xx_spi: add gpio chipselect
Date: Fri, 13 Nov 2009 11:22:31 -0700 [thread overview]
Message-ID: <fa686aa40911131022yc84ab95wd9c67ab5d03c5ecb@mail.gmail.com> (raw)
In-Reply-To: <20091113111019.GA3563@pengutronix.de>
On Fri, Nov 13, 2009 at 4:10 AM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Fri, Nov 13, 2009 at 11:41:17AM +0100, Luotao Fu wrote:
>> This one enables the mpc52xx_spi driver for usage of user defined gpio lines
>> as chipselect. This way we can control some more spi devices than only one
>>
>> V2 Changes:
>> * preinitialize the gpio as output in probe function and call gpio_set_value in
>> the chip select function instead of calling direction_output every time.
>> * initialize the gpio line with output high, since we don't support CS_HIGH
>> in the driver currently any way. change gpio value setting to default active
>> low in chip select call.
>> * free the gpio array while error or removing.
>>
>> Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
>> @@ -477,6 +520,12 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
>> err_register:
>> dev_err(&ms->master->dev, "initialization failed\n");
>> spi_master_put(master);
>> + err_gpio:
>> + while (i-- > 0)
>> + gpio_free(ms->gpio_cs[i]);
>> +
>> + if (ms->gpio_cs != NULL)
>> + kfree(ms->gpio_cs);
>
> kfree() is NULL aware, so no if needed.
Not dangerous though. No need to respin just for this.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2009-11-13 18:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 9:12 Patches for mpc52xx_spi Luotao Fu
[not found] ` <1257844329-20687-1-git-send-email-l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-10 9:12 ` [PATCH 1/3] mpc52xx_spi: fix clearing status register Luotao Fu
2009-11-10 9:12 ` [PATCH 2/3] mpc52xx_spi: add missing mode_bits definition Luotao Fu
[not found] ` <1257844329-20687-3-git-send-email-l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-10 9:12 ` [PATCH 3/3] mpc52xx_spi: add gpio chipselect Luotao Fu
2009-11-11 10:50 ` [spi-devel-general] " Wolfram Sang
2009-11-11 10:38 ` [PATCH 2/3] mpc52xx_spi: add missing mode_bits definition Wolfram Sang
2009-11-11 9:48 ` [PATCH 1/3] mpc52xx_spi: fix clearing status register Wolfram Sang
2009-11-13 10:41 ` [V2] Patches for mpc52xx_spi Luotao Fu
[not found] ` <1258108877-25435-1-git-send-email-l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-13 10:41 ` [PATCH 1/3] [V2] mpc52xx_spi: fix clearing status register Luotao Fu
2009-11-13 10:41 ` [PATCH 2/3] [V2] mpc52xx_spi: add missing mode_bits definition Luotao Fu
[not found] ` <1258108877-25435-3-git-send-email-l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2009-11-13 10:41 ` [PATCH 3/3] [V2] mpc52xx_spi: add gpio chipselect Luotao Fu
2009-11-13 11:10 ` Wolfram Sang
2009-11-13 18:22 ` Grant Likely [this message]
2009-11-13 18:53 ` [V2] Patches for mpc52xx_spi 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=fa686aa40911131022yc84ab95wd9c67ab5d03c5ecb@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=dbrownell@users.sourceforge.net \
--cc=l.fu@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=spi-devel-general@lists.sourceforge.net \
--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;
as well as URLs for NNTP newsgroup(s).