linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Stuff to make of_device more like platform_device
@ 2010-03-11 18:12 Grant Likely
  2010-03-11 18:12 ` [PATCH 1/2] arch/powerpc: Move dma_mask from of_device into pdev_archdata Grant Likely
  2010-03-11 18:12 ` [PATCH 2/2] arch/microblaze: " Grant Likely
  0 siblings, 2 replies; 3+ messages in thread
From: Grant Likely @ 2010-03-11 18:12 UTC (permalink / raw)
  To: monstr, benh, sfr, jeremy.kerr, microblaze-uclinux, linuxppc-dev,
	devicetree-discuss

These patches make it possible to use struct platform_device as a drop
in replacement for struct of_device, which is a stepping stone to
removing the duplication between the platform bus and the of bus.

g.

---

Grant Likely (2):
      arch/microblaze: Move dma_mask from of_device into pdev_archdata
      arch/powerpc: Move dma_mask from of_device into pdev_archdata


 arch/microblaze/include/asm/device.h    |    1 +
 arch/microblaze/include/asm/of_device.h |    2 +-
 arch/microblaze/kernel/of_device.c      |    2 +-
 arch/microblaze/kernel/of_platform.c    |    2 +-
 arch/powerpc/include/asm/device.h       |    1 +
 arch/powerpc/include/asm/of_device.h    |    2 +-
 arch/powerpc/kernel/of_device.c         |    2 +-
 arch/powerpc/kernel/of_platform.c       |    2 +-
 drivers/macintosh/macio_asic.c          |    4 ++--
 sound/aoa/soundbus/i2sbus/core.c        |    4 ++--
 10 files changed, 12 insertions(+), 10 deletions(-)

-- 
Signature

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

* [PATCH 1/2] arch/powerpc: Move dma_mask from of_device into pdev_archdata
  2010-03-11 18:12 [PATCH 0/2] Stuff to make of_device more like platform_device Grant Likely
@ 2010-03-11 18:12 ` Grant Likely
  2010-03-11 18:12 ` [PATCH 2/2] arch/microblaze: " Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2010-03-11 18:12 UTC (permalink / raw)
  To: monstr, benh, sfr, jeremy.kerr, microblaze-uclinux, linuxppc-dev,
	devicetree-discuss

By moving dma_mask into pdev_archdata, and adding archdata to
struct of_device, it makes it possible to substitute of_device
with struct platform_device, which is a stepping stone to
removing the of_platform bus entirely.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/powerpc/include/asm/device.h    |    1 +
 arch/powerpc/include/asm/of_device.h |    2 +-
 arch/powerpc/kernel/of_device.c      |    2 +-
 arch/powerpc/kernel/of_platform.c    |    2 +-
 drivers/macintosh/macio_asic.c       |    4 ++--
 sound/aoa/soundbus/i2sbus/core.c     |    4 ++--
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h
index 3d6ff0a..17dd2b6 100644
--- a/arch/powerpc/include/asm/device.h
+++ b/arch/powerpc/include/asm/device.h
@@ -37,6 +37,7 @@ struct dev_archdata {
 };
 
 struct pdev_archdata {
+	u64 dma_mask;
 };
 
 #endif /* _ASM_POWERPC_DEVICE_H */
diff --git a/arch/powerpc/include/asm/of_device.h b/arch/powerpc/include/asm/of_device.h
index 8b26f96..444e97e 100644
--- a/arch/powerpc/include/asm/of_device.h
+++ b/arch/powerpc/include/asm/of_device.h
@@ -12,8 +12,8 @@
  */
 struct of_device
 {
-	u64			dma_mask;	/* DMA mask */
 	struct device		dev;		/* Generic device interface */
+	struct pdev_archdata	archdata;
 };
 
 extern struct of_device *of_device_alloc(struct device_node *np,
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index 20b3474..df78e02 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -70,7 +70,7 @@ struct of_device *of_device_alloc(struct device_node *np,
 		return NULL;
 
 	dev->dev.of_node = of_node_get(np);
-	dev->dev.dma_mask = &dev->dma_mask;
+	dev->dev.dma_mask = &dev->archdata.dma_mask;
 	dev->dev.parent = parent;
 	dev->dev.release = of_release_dev;
 
diff --git a/arch/powerpc/kernel/of_platform.c b/arch/powerpc/kernel/of_platform.c
index 5a5f624..e047126 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -75,7 +75,7 @@ struct of_device* of_platform_device_create(struct device_node *np,
 	if (!dev)
 		return NULL;
 
-	dev->dma_mask = 0xffffffffUL;
+	dev->archdata.dma_mask = 0xffffffffUL;
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
 	dev->dev.bus = &of_platform_bus_type;
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 67fe13f..48a5f04 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -374,8 +374,8 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 	dev->bus = &chip->lbus;
 	dev->media_bay = in_bay;
 	dev->ofdev.dev.of_node = np;
-	dev->ofdev.dma_mask = 0xffffffffUL;
-	dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask;
+	dev->ofdev.archdata.dma_mask = 0xffffffffUL;
+	dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask;
 	dev->ofdev.dev.parent = parent;
 	dev->ofdev.dev.bus = &macio_bus_type;
 	dev->ofdev.dev.release = macio_release_dev;
diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c
index ddb1577..eebdde4 100644
--- a/sound/aoa/soundbus/i2sbus/core.c
+++ b/sound/aoa/soundbus/i2sbus/core.c
@@ -220,9 +220,9 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 
 	mutex_init(&dev->lock);
 	spin_lock_init(&dev->low_lock);
-	dev->sound.ofdev.dma_mask = macio->ofdev.dma_mask;
+	dev->sound.ofdev.archdata.dma_mask = macio->ofdev.archdata.dma_mask;
 	dev->sound.ofdev.dev.of_node = np;
-	dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.dma_mask;
+	dev->sound.ofdev.dev.dma_mask = &dev->sound.ofdev.archdata.dma_mask;
 	dev->sound.ofdev.dev.parent = &macio->ofdev.dev;
 	dev->sound.ofdev.dev.release = i2sbus_release_dev;
 	dev->sound.attach_codec = i2sbus_attach_codec;

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

* [PATCH 2/2] arch/microblaze: Move dma_mask from of_device into pdev_archdata
  2010-03-11 18:12 [PATCH 0/2] Stuff to make of_device more like platform_device Grant Likely
  2010-03-11 18:12 ` [PATCH 1/2] arch/powerpc: Move dma_mask from of_device into pdev_archdata Grant Likely
@ 2010-03-11 18:12 ` Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2010-03-11 18:12 UTC (permalink / raw)
  To: monstr, benh, sfr, jeremy.kerr, microblaze-uclinux, linuxppc-dev,
	devicetree-discuss

By moving dma_mask into pdev_archdata, and adding archdata to
struct of_device, it makes it possible to substitute of_device
with struct platform_device, which is a stepping stone to
removing the of_platform bus entirely.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---

 arch/microblaze/include/asm/device.h    |    1 +
 arch/microblaze/include/asm/of_device.h |    2 +-
 arch/microblaze/kernel/of_device.c      |    2 +-
 arch/microblaze/kernel/of_platform.c    |    2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h
index 8d46822..aae3b3c 100644
--- a/arch/microblaze/include/asm/device.h
+++ b/arch/microblaze/include/asm/device.h
@@ -15,6 +15,7 @@ struct dev_archdata {
 };
 
 struct pdev_archdata {
+	u64 dma_mask;
 };
 
 #endif /* _ASM_MICROBLAZE_DEVICE_H */
diff --git a/arch/microblaze/include/asm/of_device.h b/arch/microblaze/include/asm/of_device.h
index ab25a40..73cb980 100644
--- a/arch/microblaze/include/asm/of_device.h
+++ b/arch/microblaze/include/asm/of_device.h
@@ -21,8 +21,8 @@
  * probed using OF properties.
  */
 struct of_device {
-	u64			dma_mask; /* DMA mask */
 	struct device		dev; /* Generic device interface */
+	struct pdev_archdata	archdata;
 };
 
 extern ssize_t of_device_get_modalias(struct of_device *ofdev,
diff --git a/arch/microblaze/kernel/of_device.c b/arch/microblaze/kernel/of_device.c
index ac7e6e1..b372787 100644
--- a/arch/microblaze/kernel/of_device.c
+++ b/arch/microblaze/kernel/of_device.c
@@ -50,7 +50,7 @@ struct of_device *of_device_alloc(struct device_node *np,
 		return NULL;
 
 	dev->dev.of_node = of_node_get(np);
-	dev->dev.dma_mask = &dev->dma_mask;
+	dev->dev.dma_mask = &dev->archdata.dma_mask;
 	dev->dev.parent = parent;
 	dev->dev.release = of_release_dev;
 
diff --git a/arch/microblaze/kernel/of_platform.c b/arch/microblaze/kernel/of_platform.c
index ea7d024..f96a3a6 100644
--- a/arch/microblaze/kernel/of_platform.c
+++ b/arch/microblaze/kernel/of_platform.c
@@ -48,7 +48,7 @@ struct of_device *of_platform_device_create(struct device_node *np,
 	if (!dev)
 		return NULL;
 
-	dev->dma_mask = 0xffffffffUL;
+	dev->archdata.dma_mask = 0xffffffffUL;
 	dev->dev.bus = &of_platform_bus_type;
 
 	/* We do not fill the DMA ops for platform devices by default.

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

end of thread, other threads:[~2010-03-11 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 18:12 [PATCH 0/2] Stuff to make of_device more like platform_device Grant Likely
2010-03-11 18:12 ` [PATCH 1/2] arch/powerpc: Move dma_mask from of_device into pdev_archdata Grant Likely
2010-03-11 18:12 ` [PATCH 2/2] arch/microblaze: " Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).