diff options
author | Andreas Larsson <andreas@gaisler.com> | 2013-01-29 09:53:40 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2013-02-10 18:59:55 -0500 |
commit | 0da83bb1c9d2690465d27cb8887918e6664f647e (patch) | |
tree | 936252ab54a70d139099f7c2fba2bf4bebc6fafb | |
parent | 0d73299ddf1f4c3ea9f8606b49c4346871a3f139 (diff) |
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>
-rw-r--r-- | 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 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) | |||
1080 | if (!master->cs_gpios) | 1080 | if (!master->cs_gpios) |
1081 | return -ENOMEM; | 1081 | return -ENOMEM; |
1082 | 1082 | ||
1083 | memset(cs, -EINVAL, master->num_chipselect); | 1083 | for (i = 0; i < master->num_chipselect; i++) |
1084 | cs[i] = -EINVAL; | ||
1084 | 1085 | ||
1085 | for (i = 0; i < nb; i++) | 1086 | for (i = 0; i < nb; i++) |
1086 | cs[i] = of_get_named_gpio(np, "cs-gpios", i); | 1087 | cs[i] = of_get_named_gpio(np, "cs-gpios", i); |