mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] mtd add parent support and use pure device
@ 2012-10-16 15:18 Jean-Christophe PLAGNIOL-VILLARD
  2012-10-16 15:25 ` [PATCH 1/2] mtd: register device a " Jean-Christophe PLAGNIOL-VILLARD
  2012-10-16 20:50 ` [PATCH 0/2] mtd add parent support and use pure device Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-16 15:18 UTC (permalink / raw)
  To: barebox

HI,

The following changes since commit 11e1a135a989427fbb8920890ba6d824789a02e8:

  Merge branch 'for-next-1/bbu' into next (2012-10-16 09:38:45 +0200)

are available in the git repository at:


  git://git.jcrosoft.org/barebox.git delivery/mtd

for you to fetch changes up to 5a1bf8453e1a82200d24007394e4016cfe2bee48:

  mtd: add parent support (2012-10-16 14:23:38 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (2):
      mtd: register device a pure device
      mtd: add parent support

 drivers/mtd/core.c                  |    6 +++++-
 drivers/mtd/devices/docg3.c         |    1 +
 drivers/mtd/devices/mtd_dataflash.c |    2 ++
 drivers/mtd/nand/atmel_nand.c       |    1 +
 drivers/mtd/nand/nand_imx.c         |    2 +-
 drivers/mtd/nand/nand_mxs.c         |    1 +
 drivers/mtd/nand/nand_omap_gpmc.c   |    1 +
 drivers/mtd/nand/nand_s3c24xx.c     |    1 +
 drivers/mtd/nand/nomadik_nand.c     |    1 +
 include/linux/mtd/mtd.h             |    2 +-
 10 files changed, 15 insertions(+), 3 deletions(-)

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] mtd: register device a pure device
  2012-10-16 15:18 [PATCH 0/2] mtd add parent support and use pure device Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-16 15:25 ` Jean-Christophe PLAGNIOL-VILLARD
  2012-10-16 15:25   ` [PATCH 2/2] mtd: add parent support Jean-Christophe PLAGNIOL-VILLARD
  2012-10-16 20:50 ` [PATCH 0/2] mtd add parent support and use pure device Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-16 15:25 UTC (permalink / raw)
  To: barebox

as we do not need to probe them and they have no driver or bus attached

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/mtd/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 7c323a1..a91ef04 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -225,7 +225,7 @@ int add_mtd_device(struct mtd_info *mtd, char *devname)
 		devname = "mtd";
 	strcpy(mtd->class_dev.name, devname);
 	mtd->class_dev.id = DEVICE_ID_DYNAMIC;
-	platform_device_register(&mtd->class_dev);
+	register_device(&mtd->class_dev);
 
 	mtd->cdev.ops = &mtd_ops;
 	mtd->cdev.size = mtd->size;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mtd: add parent support
  2012-10-16 15:25 ` [PATCH 1/2] mtd: register device a " Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-16 15:25   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-16 15:25 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/mtd/core.c                  |    4 ++++
 drivers/mtd/devices/docg3.c         |    1 +
 drivers/mtd/devices/mtd_dataflash.c |    2 ++
 drivers/mtd/nand/atmel_nand.c       |    1 +
 drivers/mtd/nand/nand_imx.c         |    2 +-
 drivers/mtd/nand/nand_mxs.c         |    1 +
 drivers/mtd/nand/nand_omap_gpmc.c   |    1 +
 drivers/mtd/nand/nand_s3c24xx.c     |    1 +
 drivers/mtd/nand/nomadik_nand.c     |    1 +
 include/linux/mtd/mtd.h             |    2 +-
 10 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index a91ef04..94b7171 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -225,6 +225,10 @@ int add_mtd_device(struct mtd_info *mtd, char *devname)
 		devname = "mtd";
 	strcpy(mtd->class_dev.name, devname);
 	mtd->class_dev.id = DEVICE_ID_DYNAMIC;
+	if (mtd->parent) {
+		mtd->class_dev.parent = mtd->parent;
+		dev_add_child(mtd->class_dev.parent, &mtd->class_dev);
+	}
 	register_device(&mtd->class_dev);
 
 	mtd->cdev.ops = &mtd_ops;
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 0fe6799..2f89900 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1172,6 +1172,7 @@ static int __init docg3_probe(struct device_d *dev)
 				continue;
 		}
 		docg3_floors[floor] = mtd;
+		mtd->parent = dev;
 		ret = add_mtd_device(mtd, NULL);
 		if (ret)
 			goto err_probe;
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 9b2be51..cbed15b 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -628,6 +628,8 @@ add_dataflash_otp(struct spi_device *spi, char *name,
 	device->write = dataflash_write;
 	device->priv = priv;
 
+	device->parent = &spi->dev;
+
 	if (revision >= 'c')
 		otp_tag = otp_setup(device, revision);
 
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index aa01124..2784e39 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -363,6 +363,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
 
 	nand_chip->priv = host;		/* link the private data structures */
 	mtd->priv = nand_chip;
+	mtd->parent = dev;
 
 	/* Set address of NAND IO lines */
 	nand_chip->IO_ADDR_R = host->io_base;
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index 58dbd70..79e1f0a 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -1175,7 +1175,7 @@ static int __init imxnd_probe(struct device_d *dev)
 	this = &host->nand;
 	mtd = &host->mtd;
 	mtd->priv = this;
-	mtd->dev = dev;
+	mtd->parent = dev;
 
 	/* 50 us command delay time */
 	this->chip_delay = 5;
diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index 8aeb14d..d71983a 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -1201,6 +1201,7 @@ static int mxs_nand_probe(struct device_d *dev)
 	nand = &nand_info->nand_chip;
 	mtd = &nand_info->mtd;
 	mtd->priv = nand;
+	mtd->parent = dev;
 
 	nand->priv = nand_info;
 	nand->options |= NAND_NO_SUBPAGE_WRITE;
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index cc356f7..f4f5335 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -929,6 +929,7 @@ static int gpmc_nand_probe(struct device_d *pdev)
 
 	minfo = &oinfo->minfo;
 	minfo->priv = (void *)nand;
+	minfo->parent = dev;
 
 	if (pdata->cs >= GPMC_NUM_CS) {
 		dev_dbg(pdev, "Invalid CS!\n");
diff --git a/drivers/mtd/nand/nand_s3c24xx.c b/drivers/mtd/nand/nand_s3c24xx.c
index 12db692..aef7fa9 100644
--- a/drivers/mtd/nand/nand_s3c24xx.c
+++ b/drivers/mtd/nand/nand_s3c24xx.c
@@ -425,6 +425,7 @@ static int s3c24x0_nand_probe(struct device_d *dev)
 	chip = &host->nand;
 	mtd = &host->mtd;
 	mtd->priv = chip;
+	mtd->parent = dev;
 
 	/* init the default settings */
 
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index 6fc9398..d7e4ae5 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -197,6 +197,7 @@ static int nomadik_nand_probe(struct device_d *dev)
 	nand = &host->nand;
 	mtd->priv = nand;
 	nand->priv = host;
+	mtd->parent = dev;
 
 	nand->IO_ADDR_W = nand->IO_ADDR_R = dev_request_mem_region(dev, 2);
 	nand->cmd_ctrl = nomadik_cmd_ctrl;
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 71d3c6f..8114967 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -200,7 +200,7 @@ struct mtd_info {
 	void (*put_device) (struct mtd_info *mtd);
 
 	struct device_d class_dev;
-	struct device_d *dev;
+	struct device_d *parent;
 	struct cdev cdev;
 
 	struct param_d param_size;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] mtd add parent support and use pure device
  2012-10-16 15:18 [PATCH 0/2] mtd add parent support and use pure device Jean-Christophe PLAGNIOL-VILLARD
  2012-10-16 15:25 ` [PATCH 1/2] mtd: register device a " Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-16 20:50 ` Sascha Hauer
  2012-10-17  6:46   ` Sascha Hauer
  1 sibling, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2012-10-16 20:50 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Oct 16, 2012 at 05:18:31PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> HI,
> 
> The following changes since commit 11e1a135a989427fbb8920890ba6d824789a02e8:
> 
>   Merge branch 'for-next-1/bbu' into next (2012-10-16 09:38:45 +0200)
> 
> are available in the git repository at:
> 
> 
>   git://git.jcrosoft.org/barebox.git delivery/mtd

Applied, thanks

Sascha

> 
> for you to fetch changes up to 5a1bf8453e1a82200d24007394e4016cfe2bee48:
> 
>   mtd: add parent support (2012-10-16 14:23:38 +0800)
> 
> ----------------------------------------------------------------
> Jean-Christophe PLAGNIOL-VILLARD (2):
>       mtd: register device a pure device
>       mtd: add parent support
> 
>  drivers/mtd/core.c                  |    6 +++++-
>  drivers/mtd/devices/docg3.c         |    1 +
>  drivers/mtd/devices/mtd_dataflash.c |    2 ++
>  drivers/mtd/nand/atmel_nand.c       |    1 +
>  drivers/mtd/nand/nand_imx.c         |    2 +-
>  drivers/mtd/nand/nand_mxs.c         |    1 +
>  drivers/mtd/nand/nand_omap_gpmc.c   |    1 +
>  drivers/mtd/nand/nand_s3c24xx.c     |    1 +
>  drivers/mtd/nand/nomadik_nand.c     |    1 +
>  include/linux/mtd/mtd.h             |    2 +-
>  10 files changed, 15 insertions(+), 3 deletions(-)
> 
> Best Regards,
> J.
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] mtd add parent support and use pure device
  2012-10-16 20:50 ` [PATCH 0/2] mtd add parent support and use pure device Sascha Hauer
@ 2012-10-17  6:46   ` Sascha Hauer
  0 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-10-17  6:46 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox

On Tue, Oct 16, 2012 at 10:50:53PM +0200, Sascha Hauer wrote:
> On Tue, Oct 16, 2012 at 05:18:31PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > HI,
> > 
> > The following changes since commit 11e1a135a989427fbb8920890ba6d824789a02e8:
> > 
> >   Merge branch 'for-next-1/bbu' into next (2012-10-16 09:38:45 +0200)
> > 
> > are available in the git repository at:
> > 
> > 
> >   git://git.jcrosoft.org/barebox.git delivery/mtd
> 
> Applied, thanks

And fixed the resulting compilation errors in the OMAP nand driver.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-17  6:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16 15:18 [PATCH 0/2] mtd add parent support and use pure device Jean-Christophe PLAGNIOL-VILLARD
2012-10-16 15:25 ` [PATCH 1/2] mtd: register device a " Jean-Christophe PLAGNIOL-VILLARD
2012-10-16 15:25   ` [PATCH 2/2] mtd: add parent support Jean-Christophe PLAGNIOL-VILLARD
2012-10-16 20:50 ` [PATCH 0/2] mtd add parent support and use pure device Sascha Hauer
2012-10-17  6:46   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox