[PATCH 2/7] mtd: brcmnand: do not make local variable static

Hauke Mehrtens hauke at hauke-m.de
Sun May 17 08:41:01 PDT 2015


Remove static in front of ctrl. This variable should not be shared
between different instances of brcmnand_probe(), it should be local to
this function and stored on the stack.

Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 drivers/mtd/nand/brcmnand/brcmnand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/brcmnand/brcmnand.c b/drivers/mtd/nand/brcmnand/brcmnand.c
index bae30ab..a48ad49 100644
--- a/drivers/mtd/nand/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/brcmnand/brcmnand.c
@@ -2069,7 +2069,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *dn = dev->of_node, *child;
-	static struct brcmnand_controller *ctrl;
+	struct brcmnand_controller *ctrl;
 	struct resource *res;
 	int ret;
 
-- 
2.1.4




More information about the linux-mtd mailing list