Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);