[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1356610247-11491-4-git-send-email-andreas@gaisler.com>
Date: Thu, 27 Dec 2012 13:10:44 +0100
From: Andreas Larsson <andreas@...sler.com>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Rob Herring <rob.herring@...xeda.com>,
Linus Walleij <linus.walleij@...aro.org>,
devicetree-discuss@...ts.ozlabs.org,
spi-devel-general@...ts.sourceforge.net,
linux-kernel@...r.kernel.org, software@...sler.com
Subject: [PATCH 3/6] of_spi: Initialize cs_gpios properly
Using memset does not set an array of integers properly
Signed-off-by: Andreas Larsson <andreas@...sler.com>
---
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 9c2acf1..a4baa0a 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1083,7 +1083,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);
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists