Message ID | 20151101233237.21155d9e@bbrezillon |
---|---|
State | Accepted |
Headers | show |
On Sun, Nov 01, 2015 at 11:32:37PM +0100, Boris Brezillon wrote: > On Fri, 30 Oct 2015 20:33:25 -0700 > Brian Norris <computersforpeace@gmail.com> wrote: > [...] > > diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c > > index dcb1f7f4873f..850546dc98c8 100644 > > --- a/drivers/mtd/nand/fsl_elbc_nand.c > > +++ b/drivers/mtd/nand/fsl_elbc_nand.c > > @@ -748,6 +748,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) > > /* Fill in fsl_elbc_mtd structure */ > > priv->mtd.priv = chip; > > priv->mtd.dev.parent = priv->dev; > > + chip->flash_node = priv->dev->of_node; > > Shouldn't we use the nand_set_flash_node() helper here? Here is a diff replacing > all 'chip->flash_node =' occurrences by nand_set_flash_node(): Hmm, I don't know why I overlooked those. I think maybe I did the initial replacement before this patch and forgot to do the same replacement on my subsequent work. I guess that's what happens when I rebase/rework too much... Thanks for the diff. I'll probably squash it into v3 if/when that comes. Brian
On Mon, Nov 02, 2015 at 01:00:01PM -0800, Brian Norris wrote: > On Sun, Nov 01, 2015 at 11:32:37PM +0100, Boris Brezillon wrote: > > On Fri, 30 Oct 2015 20:33:25 -0700 > > Brian Norris <computersforpeace@gmail.com> wrote: > > > [...] > > > diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c > > > index dcb1f7f4873f..850546dc98c8 100644 > > > --- a/drivers/mtd/nand/fsl_elbc_nand.c > > > +++ b/drivers/mtd/nand/fsl_elbc_nand.c > > > @@ -748,6 +748,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) > > > /* Fill in fsl_elbc_mtd structure */ > > > priv->mtd.priv = chip; > > > priv->mtd.dev.parent = priv->dev; > > > + chip->flash_node = priv->dev->of_node; > > > > Shouldn't we use the nand_set_flash_node() helper here? Here is a diff replacing > > all 'chip->flash_node =' occurrences by nand_set_flash_node(): > > Hmm, I don't know why I overlooked those. I think maybe I did the > initial replacement before this patch and forgot to do the same > replacement on my subsequent work. I guess that's what happens when I > rebase/rework too much... > > Thanks for the diff. I'll probably squash it into v3 if/when that comes. Pushed my patch 6 + your diff to l2-mtd.git/next. Thanks!
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index 850546d..bd6d493 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -748,7 +748,7 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv) /* Fill in fsl_elbc_mtd structure */ priv->mtd.priv = chip; priv->mtd.dev.parent = priv->dev; - chip->flash_node = priv->dev->of_node; + nand_set_flash_node(chip, priv->dev->of_node); /* set timeout to maximum */ priv->fmr = 15 << FMR_CWTO_SHIFT; diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index 8ae2a23..f260831 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -883,7 +883,7 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv) /* Fill in fsl_ifc_mtd structure */ priv->mtd.priv = chip; priv->mtd.dev.parent = priv->dev; - chip->flash_node = priv->dev->of_node; + nand_set_flash_node(chip, priv->dev->of_node); /* fill in nand_chip structure */ /* set up function call table */ diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c index ffe416c..b3f4a01 100644 --- a/drivers/mtd/nand/fsl_upm.c +++ b/drivers/mtd/nand/fsl_upm.c @@ -181,7 +181,7 @@ static int fun_chip_init(struct fsl_upm_nand *fun, if (!flash_np) return -ENODEV; - fun->chip.flash_node = flash_np; + nand_set_flash_node(&fun->chip, flash_np); fun->mtd.name = kasprintf(GFP_KERNEL, "0x%llx.%s", (u64)io_res->start, flash_np->name); if (!fun->mtd.name) { diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index 289a48c..d57a07a 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c @@ -267,7 +267,7 @@ static int gpio_nand_probe(struct platform_device *pdev) chip->dev_ready = gpio_nand_devready; } - chip->flash_node = pdev->dev.of_node; + nand_set_flash_node(chip, pdev->dev.of_node); chip->IO_ADDR_W = chip->IO_ADDR_R; chip->ecc.mode = NAND_ECC_SOFT; chip->options = gpiomtd->plat.options; diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 90e49cc..5a9b696 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c @@ -1900,7 +1900,7 @@ static int gpmi_nand_init(struct gpmi_nand_data *this) /* init the nand_chip{}, we don't support a 16-bit NAND Flash bus. */ chip->priv = this; - chip->flash_node = this->pdev->dev.of_node; + nand_set_flash_node(chip, this->pdev->dev.of_node); chip->select_chip = gpmi_select_chip; chip->cmd_ctrl = gpmi_cmd_ctrl; chip->dev_ready = gpmi_dev_ready; diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c index 3ccad8c..57c4b71 100644 --- a/drivers/mtd/nand/lpc32xx_mlc.c +++ b/drivers/mtd/nand/lpc32xx_mlc.c @@ -681,7 +681,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) host->pdata = dev_get_platdata(&pdev->dev); nand_chip->priv = host; /* link the private data structures */ - nand_chip->flash_node = pdev->dev.of_node; + nand_set_flash_node(nand_chip, pdev->dev.of_node); mtd->priv = nand_chip; mtd->dev.parent = &pdev->dev; diff --git a/drivers/mtd/nand/lpc32xx_slc.c b/drivers/mtd/nand/lpc32xx_slc.c index 9cb8206..277626e 100644 --- a/drivers/mtd/nand/lpc32xx_slc.c +++ b/drivers/mtd/nand/lpc32xx_slc.c @@ -802,7 +802,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) mtd = &host->mtd; chip = &host->nand_chip; chip->priv = host; - chip->flash_node = pdev->dev.of_node; + nand_set_flash_node(chip, pdev->dev.of_node); mtd->priv = chip; mtd->owner = THIS_MODULE; mtd->dev.parent = &pdev->dev; diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 0fc4f3a..7922d31 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -1524,7 +1524,7 @@ static int mxcnd_probe(struct platform_device *pdev) this->chip_delay = 5; this->priv = host; - this->flash_node = pdev->dev.of_node, + nand_set_flash_node(this, pdev->dev.of_node), this->dev_ready = mxc_nand_dev_ready; this->cmdfunc = mxc_nand_command; this->read_byte = mxc_nand_read_byte; diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 33718dc..e307576 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1687,7 +1687,7 @@ static int omap_nand_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; nand_chip = &info->nand; nand_chip->ecc.priv = NULL; - nand_chip->flash_node = pdata->of_node; + nand_set_flash_node(nand_chip, pdata->of_node); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); nand_chip->IO_ADDR_R = devm_ioremap_resource(&pdev->dev, res); diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 0728ddc..5c21416 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c @@ -126,7 +126,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) mtd->dev.parent = &pdev->dev; nc->priv = board; - nc->flash_node = pdev->dev.of_node; + nand_set_flash_node(nc, pdev->dev.of_node); nc->IO_ADDR_R = nc->IO_ADDR_W = io_base; nc->cmd_ctrl = orion_nand_cmd_ctrl; nc->read_buf = orion_nand_read_buf; diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 034becc..06ac6c6 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -57,7 +57,7 @@ static int plat_nand_probe(struct platform_device *pdev) return PTR_ERR(data->io_base); data->chip.priv = &data; - data->chip.flash_node = pdev->dev.of_node; + nand_set_flash_node(&data->chip, pdev->dev.of_node); data->mtd.priv = &data->chip; data->mtd.dev.parent = &pdev->dev; diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index ec2ade9..57dc525 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -1122,7 +1122,7 @@ static int flctl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, flctl); flctl_mtd = &flctl->mtd; nand = &flctl->chip; - nand->flash_node = pdev->dev.of_node; + nand_set_flash_node(nand, pdev->dev.of_node); flctl_mtd->priv = nand; flctl_mtd->dev.parent = &pdev->dev; flctl->pdev = pdev; diff --git a/drivers/mtd/nand/socrates_nand.c b/drivers/mtd/nand/socrates_nand.c index f935985..bde4043 100644 --- a/drivers/mtd/nand/socrates_nand.c +++ b/drivers/mtd/nand/socrates_nand.c @@ -164,7 +164,7 @@ static int socrates_nand_probe(struct platform_device *ofdev) host->dev = &ofdev->dev; nand_chip->priv = host; /* link the private data structures */ - nand_chip->flash_node = ofdev->dev.of_node; + nand_set_flash_node(nand_chip, ofdev->dev.of_node); mtd->priv = nand_chip; mtd->name = "socrates_nand"; mtd->dev.parent = &ofdev->dev; diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index bd9b5b0..49807de 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -896,7 +896,7 @@ static int spinand_probe(struct spi_device *spi_nand) pr_info("%s: disable ecc failed!\n", __func__); #endif - chip->flash_node = spi_nand->dev.of_node; + nand_set_flash_node(chip, spi_nand->dev.of_node); chip->priv = info; chip->read_buf = spinand_read_buf; chip->write_buf = spinand_write_buf;