Skip to contentSkip to conversation

mtd: brcmnand: drop brcmnand_host::of_node field

PATCH In review Brian Norris 2 participants 3 messages Nov 30, 2015 – Dec 1, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: brcmnand: drop brcmnand_host::of_node field

We don't actually need to stash a copy of this device_node indefinitely; we only need it in brcmnand_init_cs().

---
 drivers/mtd/nand/brcmnand/brcmnand.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mtd/nand/brcmnand/brcmnand.c +2 -5
index ad756f626f4b..35d78f739d91 100644
@@ -176,7 +176,6 @@ struct brcmnand_cfg {
 
 struct brcmnand_host {
 	struct list_head	node;
-	struct device_node	*of_node;
 
 	struct nand_chip	chip;
 	struct mtd_info		mtd;
@@ -1902,10 +1901,9 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
 	return 0;
 }
 
-static int brcmnand_init_cs(struct brcmnand_host *host)
+static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
 {
 	struct brcmnand_controller *ctrl = host->ctrl;
-	struct device_node *dn = host->of_node;
 	struct platform_device *pdev = host->pdev;
 	struct mtd_info *mtd;
 	struct nand_chip *chip;
@@ -2239,9 +2237,8 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 			}
 			host->pdev = pdev;
 			host->ctrl = ctrl;
-			host->of_node = child;
 
-			ret = brcmnand_init_cs(host);
+			ret = brcmnand_init_cs(host, child);
 			if (ret) {
 				devm_kfree(dev, host);
 				continue; /* Try all chip-selects */
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
Acked-by on v1 1/1
#1 lore raw

Looks good.

Quoted 6 lines · Brian Norris

We don't actually need to stash a copy of this device_node indefinitely; we only need it in brcmnand_init_cs().

Quoted 40 lines
---
  drivers/mtd/nand/brcmnand/brcmnand.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mtd/nand/brcmnand/brcmnand.c +2 -5
index ad756f626f4b..35d78f739d91 100644
@@ -176,7 +176,6 @@ struct brcmnand_cfg {
 
  struct brcmnand_host {
  	struct list_head	node;
-	struct device_node	*of_node;
 
  	struct nand_chip	chip;
  	struct mtd_info		mtd;
@@ -1902,10 +1901,9 @@ static int brcmnand_setup_dev(struct brcmnand_host *host)
  	return 0;
  }
 
-static int brcmnand_init_cs(struct brcmnand_host *host)
+static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
  {
  	struct brcmnand_controller *ctrl = host->ctrl;
-	struct device_node *dn = host->of_node;
  	struct platform_device *pdev = host->pdev;
  	struct mtd_info *mtd;
  	struct nand_chip *chip;
@@ -2239,9 +2237,8 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
  			}
  			host->pdev = pdev;
  			host->ctrl = ctrl;
-			host->of_node = child;
 
-			ret = brcmnand_init_cs(host);
+			ret = brcmnand_init_cs(host, child);
  			if (ret) {
  				devm_kfree(dev, host);
  				continue; /* Try all chip-selects */