The above code doesn't look great but we don't want to add phys_to_dma
and dma_to_phys to dma_map_ops struct, and these functions on MIPS
looks too complicated for ifdef. So I guess that we need to live with
the above code.

I think you have a point here. I will attempt to move these two into a
chip specific operations vector, and leave the more generic MIPS version
with the simplified static definition.