summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorAndreas Larsson <andreas@gaisler.com>2013-01-29 15:53:40 +0100
committerGrant Likely <grant.likely@secretlab.ca>2013-02-11 00:59:55 +0100
commit0da83bb1c9d2690465d27cb8887918e6664f647e (patch)
tree936252ab54a70d139099f7c2fba2bf4bebc6fafb /drivers/spi/spi.c
parentMerge branch spi-next from git://git.kernel.org/pub/scm/linux/kernel/git/broo... (diff)
downloadlinux-0da83bb1c9d2690465d27cb8887918e6664f647e.tar.xz
linux-0da83bb1c9d2690465d27cb8887918e6664f647e.zip
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>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d1e0a316826d..6707cb2f4fa4 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -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);