Modifies get_dma_ops() implementation on ppc arch to check null condition for dev->archdata.dma_ops; returns common dma_direct_ops structure in case its NULL
Signed-off-by: Nikhil Badola <nikhil.bad...@freescale.com> --- arch/powerpc/include/asm/dma-mapping.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 150866b..d73bae8 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h @@ -86,10 +86,12 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) */ if (unlikely(dev == NULL)) return NULL; - - return dev->archdata.dma_ops; + if (dev->archdata.dma_ops) + return dev->archdata.dma_ops; + return &dma_direct_ops; } + static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) { dev->archdata.dma_ops = ops; -- 1.7.11.7 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev