Skip to content

Commit

Permalink
powerpc: expect all devices calling dma ops to have archdata set
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Kumar Gala authored and Benjamin Herrenschmidt committed Mar 24, 2009
1 parent d746286 commit 4ae0ff6
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions arch/powerpc/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4ae0ff6

Please sign in to comment.