aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-04-13 19:12:29 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-18 18:10:44 -0400
commit61c7a080a5a061c976988fd4b844dfb468dda255 (patch)
tree8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/mtd
parentd12d42f744f805a9ccc33cd76f04b237cd83ce56 (diff)
of: Always use 'struct device.of_node' to get device node pointer.
The following structure elements duplicate the information in 'struct device.of_node' and so are being eliminated. This patch makes all readers of these elements use device.of_node instead. (struct of_device *)->node (struct dev_archdata *)->prom_node (sparc) (struct dev_archdata *)->of_node (powerpc & microblaze) Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/maps/physmap_of.c6
-rw-r--r--drivers/mtd/maps/sun_uflash.c2
-rw-r--r--drivers/mtd/nand/fsl_elbc_nand.c6
-rw-r--r--drivers/mtd/nand/ndfc.c10
-rw-r--r--drivers/mtd/nand/pasemi_nand.c2
5 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index 101ee6ead05c..3dc7a2fbf025 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -143,7 +143,7 @@ static int of_flash_remove(struct of_device *dev)
143static struct mtd_info * __devinit obsolete_probe(struct of_device *dev, 143static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
144 struct map_info *map) 144 struct map_info *map)
145{ 145{
146 struct device_node *dp = dev->node; 146 struct device_node *dp = dev->dev.of_node;
147 const char *of_probe; 147 const char *of_probe;
148 struct mtd_info *mtd; 148 struct mtd_info *mtd;
149 static const char *rom_probe_types[] 149 static const char *rom_probe_types[]
@@ -180,7 +180,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
180 static const char *part_probe_types[] 180 static const char *part_probe_types[]
181 = { "cmdlinepart", "RedBoot", NULL }; 181 = { "cmdlinepart", "RedBoot", NULL };
182#endif 182#endif
183 struct device_node *dp = dev->node; 183 struct device_node *dp = dev->dev.of_node;
184 struct resource res; 184 struct resource res;
185 struct of_flash *info; 185 struct of_flash *info;
186 const char *probe_type = match->data; 186 const char *probe_type = match->data;
@@ -204,7 +204,7 @@ static int __devinit of_flash_probe(struct of_device *dev,
204 p = of_get_property(dp, "reg", &count); 204 p = of_get_property(dp, "reg", &count);
205 if (count % reg_tuple_size != 0) { 205 if (count % reg_tuple_size != 0) {
206 dev_err(&dev->dev, "Malformed reg property on %s\n", 206 dev_err(&dev->dev, "Malformed reg property on %s\n",
207 dev->node->full_name); 207 dev->dev.of_node->full_name);
208 err = -EINVAL; 208 err = -EINVAL;
209 goto err_flash_remove; 209 goto err_flash_remove;
210 } 210 }
diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c
index fadc4c45b455..5945a23e681f 100644
--- a/drivers/mtd/maps/sun_uflash.c
+++ b/drivers/mtd/maps/sun_uflash.c
@@ -110,7 +110,7 @@ int uflash_devinit(struct of_device *op, struct device_node *dp)
110 110
111static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match) 111static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match)
112{ 112{
113 struct device_node *dp = op->node; 113 struct device_node *dp = op->dev.of_node;
114 114
115 /* Flashprom must have the "user" property in order to 115 /* Flashprom must have the "user" property in order to
116 * be used by this driver. 116 * be used by this driver.
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index ae30fb6eed97..4a6079588ab2 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -1030,14 +1030,14 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev,
1030 init_waitqueue_head(&ctrl->controller.wq); 1030 init_waitqueue_head(&ctrl->controller.wq);
1031 init_waitqueue_head(&ctrl->irq_wait); 1031 init_waitqueue_head(&ctrl->irq_wait);
1032 1032
1033 ctrl->regs = of_iomap(ofdev->node, 0); 1033 ctrl->regs = of_iomap(ofdev->dev.of_node, 0);
1034 if (!ctrl->regs) { 1034 if (!ctrl->regs) {
1035 dev_err(&ofdev->dev, "failed to get memory region\n"); 1035 dev_err(&ofdev->dev, "failed to get memory region\n");
1036 ret = -ENODEV; 1036 ret = -ENODEV;
1037 goto err; 1037 goto err;
1038 } 1038 }
1039 1039
1040 ctrl->irq = of_irq_to_resource(ofdev->node, 0, NULL); 1040 ctrl->irq = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
1041 if (ctrl->irq == NO_IRQ) { 1041 if (ctrl->irq == NO_IRQ) {
1042 dev_err(&ofdev->dev, "failed to get irq resource\n"); 1042 dev_err(&ofdev->dev, "failed to get irq resource\n");
1043 ret = -ENODEV; 1043 ret = -ENODEV;
@@ -1058,7 +1058,7 @@ static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev,
1058 goto err; 1058 goto err;
1059 } 1059 }
1060 1060
1061 for_each_child_of_node(ofdev->node, child) 1061 for_each_child_of_node(ofdev->dev.of_node, child)
1062 if (of_device_is_compatible(child, "fsl,elbc-fcm-nand")) 1062 if (of_device_is_compatible(child, "fsl,elbc-fcm-nand"))
1063 fsl_elbc_chip_probe(ctrl, child); 1063 fsl_elbc_chip_probe(ctrl, child);
1064 1064
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index b983cae8c298..c0e05f5ff8a4 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -239,14 +239,14 @@ static int __devinit ndfc_probe(struct of_device *ofdev,
239 dev_set_drvdata(&ofdev->dev, ndfc); 239 dev_set_drvdata(&ofdev->dev, ndfc);
240 240
241 /* Read the reg property to get the chip select */ 241 /* Read the reg property to get the chip select */
242 reg = of_get_property(ofdev->node, "reg", &len); 242 reg = of_get_property(ofdev->dev.of_node, "reg", &len);
243 if (reg == NULL || len != 12) { 243 if (reg == NULL || len != 12) {
244 dev_err(&ofdev->dev, "unable read reg property (%d)\n", len); 244 dev_err(&ofdev->dev, "unable read reg property (%d)\n", len);
245 return -ENOENT; 245 return -ENOENT;
246 } 246 }
247 ndfc->chip_select = reg[0]; 247 ndfc->chip_select = reg[0];
248 248
249 ndfc->ndfcbase = of_iomap(ofdev->node, 0); 249 ndfc->ndfcbase = of_iomap(ofdev->dev.of_node, 0);
250 if (!ndfc->ndfcbase) { 250 if (!ndfc->ndfcbase) {
251 dev_err(&ofdev->dev, "failed to get memory\n"); 251 dev_err(&ofdev->dev, "failed to get memory\n");
252 return -EIO; 252 return -EIO;
@@ -255,20 +255,20 @@ static int __devinit ndfc_probe(struct of_device *ofdev,
255 ccr = NDFC_CCR_BS(ndfc->chip_select); 255 ccr = NDFC_CCR_BS(ndfc->chip_select);
256 256
257 /* It is ok if ccr does not exist - just default to 0 */ 257 /* It is ok if ccr does not exist - just default to 0 */
258 reg = of_get_property(ofdev->node, "ccr", NULL); 258 reg = of_get_property(ofdev->dev.of_node, "ccr", NULL);
259 if (reg) 259 if (reg)
260 ccr |= *reg; 260 ccr |= *reg;
261 261
262 out_be32(ndfc->ndfcbase + NDFC_CCR, ccr); 262 out_be32(ndfc->ndfcbase + NDFC_CCR, ccr);
263 263
264 /* Set the bank settings if given */ 264 /* Set the bank settings if given */
265 reg = of_get_property(ofdev->node, "bank-settings", NULL); 265 reg = of_get_property(ofdev->dev.of_node, "bank-settings", NULL);
266 if (reg) { 266 if (reg) {
267 int offset = NDFC_BCFG0 + (ndfc->chip_select << 2); 267 int offset = NDFC_BCFG0 + (ndfc->chip_select << 2);
268 out_be32(ndfc->ndfcbase + offset, *reg); 268 out_be32(ndfc->ndfcbase + offset, *reg);
269 } 269 }
270 270
271 err = ndfc_chip_init(ndfc, ofdev->node); 271 err = ndfc_chip_init(ndfc, ofdev->dev.of_node);
272 if (err) { 272 if (err) {
273 iounmap(ndfc->ndfcbase); 273 iounmap(ndfc->ndfcbase);
274 return err; 274 return err;
diff --git a/drivers/mtd/nand/pasemi_nand.c b/drivers/mtd/nand/pasemi_nand.c
index a8b9376cf324..edfc27b78513 100644
--- a/drivers/mtd/nand/pasemi_nand.c
+++ b/drivers/mtd/nand/pasemi_nand.c
@@ -93,7 +93,7 @@ static int __devinit pasemi_nand_probe(struct of_device *ofdev,
93 const struct of_device_id *match) 93 const struct of_device_id *match)
94{ 94{
95 struct pci_dev *pdev; 95 struct pci_dev *pdev;
96 struct device_node *np = ofdev->node; 96 struct device_node *np = ofdev->dev.of_node;
97 struct resource res; 97 struct resource res;
98 struct nand_chip *chip; 98 struct nand_chip *chip;
99 int err = 0; 99 int err = 0;