spi/of: Fix initialization of cs_gpios array

Using memset does not set an array of integers properly. Replace with a
loop to set each element properly.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Andreas Larsson 2013-01-29 15:53:40 +01:00 committed by Grant Likely
parent 0d73299ddf
commit 0da83bb1c9
1 changed files with 2 additions and 1 deletions

View File

@ -1080,7 +1080,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);