lkml.org 
[lkml]   [2013]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 3/6] of_spi: Initialize cs_gpios properly
Date
On Tue, 29 Jan 2013 15:53:40 +0100, Andreas Larsson <andreas@gaisler.com> wrote:
> Using memset does not set an array of integers properly
>
> Signed-off-by: Andreas Larsson <andreas@gaisler.com>

Applied, thanks.

g.

> ---
> drivers/spi/spi.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 9c2acf1..a4baa0a 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1083,7 +1083,8 @@ static int of_spi_register_master(struct spi_master *master)
> if (!master->cs_gpios)
> return -ENOMEM;
>
> - memset(cs, -EINVAL, master->num_chipselect);
> + for (i = 0; i < master->num_chipselect; i++)
> + cs[i] = -EINVAL;
>
> for (i = 0; i < nb; i++)
> cs[i] = of_get_named_gpio(np, "cs-gpios", i);
> --
> 1.7.0.4
>

--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.


\
 
 \ /
  Last update: 2013-02-11 01:21    [W:0.107 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site