Commit 0da83bb1 authored by Andreas Larsson's avatar Andreas Larsson Committed by Grant Likely

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: default avatarAndreas Larsson <andreas@gaisler.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 0d73299d
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment