diff mbox

[V2,06/10] of/drivers: Always use struct device.of_node to get node pointer

Message ID 20100318131047.6dbdef73@lappy.seanm.ca (mailing list archive)
State Not Applicable
Headers show

Commit Message

Sean MacLennan March 18, 2010, 5:10 p.m. UTC
On Thu, 18 Mar 2010 11:07:35 -0600
Grant Likely <grant.likely@secretlab.ca> wrote:

> On Thu, Mar 18, 2010 at 10:59 AM, Sean MacLennan
> <smaclennan@pikatech.com> wrote:
> > On Thu, 18 Mar 2010 09:22:39 -0600
> > Grant Likely <grant.likely@secretlab.ca> wrote:
> >
> >> The following structure elements duplicate the information in
> >> 'struct device.of_node' and so are being eliminated.  This patches
> >> makes all readers of the following elements use device.of_node
> >> instead.
> >
> > The NDFC driver also needs a patch... or at least the version from
> > your last of_patch set does. I am included the patch I needed to
> > get it to compile.
> 
> Thanks Sean, I've added this patch to my series.  s-o-b line please?
> 
> g.

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff mbox

Patch

diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 19d94a2..5a232ec 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -238,14 +238,14 @@  static int __devinit ndfc_probe(struct of_device *ofdev,
 	dev_set_drvdata(&ofdev->dev, ndfc);
 
 	/* Read the reg property to get the chip select */
-	reg = of_get_property(ofdev->node, "reg", &len);
+	reg = of_get_property(ofdev->dev.of_node, "reg", &len);
 	if (reg == NULL || len != 12) {
 		dev_err(&ofdev->dev, "unable read reg property (%d)\n", len);
 		return -ENOENT;
 	}
 	ndfc->chip_select = reg[0];
 
-	ndfc->ndfcbase = of_iomap(ofdev->node, 0);
+	ndfc->ndfcbase = of_iomap(ofdev->dev.of_node, 0);
 	if (!ndfc->ndfcbase) {
 		dev_err(&ofdev->dev, "failed to get memory\n");
 		return -EIO;
@@ -254,20 +254,20 @@  static int __devinit ndfc_probe(struct of_device *ofdev,
 	ccr = NDFC_CCR_BS(ndfc->chip_select);
 
 	/* It is ok if ccr does not exist - just default to 0 */
-	reg = of_get_property(ofdev->node, "ccr", NULL);
+	reg = of_get_property(ofdev->dev.of_node, "ccr", NULL);
 	if (reg)
 		ccr |= *reg;
 
 	out_be32(ndfc->ndfcbase + NDFC_CCR, ccr);
 
 	/* Set the bank settings if given */
-	reg = of_get_property(ofdev->node, "bank-settings", NULL);
+	reg = of_get_property(ofdev->dev.of_node, "bank-settings", NULL);
 	if (reg) {
 		int offset = NDFC_BCFG0 + (ndfc->chip_select << 2);
 		out_be32(ndfc->ndfcbase + offset, *reg);
 	}
 
-	err = ndfc_chip_init(ndfc, ofdev->node);
+	err = ndfc_chip_init(ndfc, ofdev->dev.of_node);
 	if (err) {
 		iounmap(ndfc->ndfcbase);
 		return err;