提交 0da83bb1 编写于 作者: A Andreas Larsson 提交者: 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: NAndreas Larsson <andreas@gaisler.com>
Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册