mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-16 22:51:32 +00:00
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:
parent
0d73299ddf
commit
0da83bb1c9
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user