Stuff to make of_device more like platform_device
Subsystems (5)
cover Stuff to make of_device more like platform_device
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 · 1 line
Signature
PATCH 1/2 arch/powerpc: Move dma_mask from of_device into pdev_archdata
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.
---
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(-)
arch/powerpc/include/asm/device.h +1 -0
@@ -37,6 +37,7 @@ struct dev_archdata { };struct pdev_archdata { +u64 dma_mask; };#endif /* _ASM_POWERPC_DEVICE_H */
arch/powerpc/include/asm/of_device.h +1 -1
@@ -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,
arch/powerpc/kernel/of_device.c +1 -1
@@ -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;
arch/powerpc/kernel/of_platform.c +1 -1
@@ -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;
drivers/macintosh/macio_asic.c +2 -2
@@ -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;
sound/aoa/soundbus/i2sbus/core.c +2 -2
@@ -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;
PATCH 2/2 arch/microblaze: Move dma_mask from of_device into pdev_archdata
In reply to Grant LikelyBy 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.
---
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(-)
arch/microblaze/include/asm/device.h +1 -0
@@ -15,6 +15,7 @@ struct dev_archdata { };struct pdev_archdata { +u64 dma_mask; };#endif /* _ASM_MICROBLAZE_DEVICE_H */
arch/microblaze/include/asm/of_device.h +1 -1
@@ -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,
arch/microblaze/kernel/of_device.c +1 -1
@@ -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;
arch/microblaze/kernel/of_platform.c +1 -1
@@ -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.