| Submitter | Kumar Gala |
|---|---|
| Date | March 19, 2009, 1:40 p.m. |
| Message ID | <1237470052-4071-3-git-send-email-galak@kernel.crashing.org> |
| Download | mbox | patch |
| Permalink | /patch/24678/ |
| State | Accepted |
| Delegated to: | Benjamin Herrenschmidt |
| Headers | show |
Comments
* Kumar Gala | 2009-03-19 08:40:52 [-0500]: >Now that we set archdata for of_platform and platform devices via >platform_notify() we no longer need to special case having a NULL device >pointer or NULL archdata. It should be a driver error if this condition >shows up and the driver should be fixed. > >Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Benjamin Krill <ben@codiert.org> Tested on QPACE node card.
Patch
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 86cef7d..c69f2b5 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -109,18 +109,8 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) * only ISA DMA device we support is the floppy and we have a hack * in the floppy driver directly to get a device for us. */ - - if (unlikely(dev == NULL) || dev->archdata.dma_ops == NULL) { -#ifdef CONFIG_PPC64 + if (unlikely(dev == NULL)) return NULL; -#else - /* Use default on 32-bit if dma_ops is not set up */ - /* TODO: Long term, we should fix drivers so that dev and - * archdata dma_ops are set up for all buses. - */ - return &dma_direct_ops; -#endif - } return dev->archdata.dma_ops; }
Now that we set archdata for of_platform and platform devices via platform_notify() we no longer need to special case having a NULL device pointer or NULL archdata. It should be a driver error if this condition shows up and the driver should be fixed. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> --- arch/powerpc/include/asm/dma-mapping.h | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-)