提交 4ae0ff60 编写于 作者: K Kumar Gala 提交者: Benjamin Herrenschmidt

powerpc: expect all devices calling dma ops to have archdata set

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: NKumar Gala <galak@kernel.crashing.org>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 d746286c
...@@ -109,18 +109,8 @@ static inline struct dma_mapping_ops *get_dma_ops(struct device *dev) ...@@ -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 * 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. * in the floppy driver directly to get a device for us.
*/ */
if (unlikely(dev == NULL))
if (unlikely(dev == NULL) || dev->archdata.dma_ops == NULL) {
#ifdef CONFIG_PPC64
return 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; return dev->archdata.dma_ops;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册