Skip to content

Commit aea7296

Browse files
Baoquan Hearndb
authored andcommitted
mips: io: remove duplicated codes
By adding <asm-generic/io.h> support, the duplicated phys_to_virt can be removed to use the default version in <asm-gneneric/io.h>. Meanwhile move isa_bus_to_virt() down below <asm-generic/io.h> including to fix the compiling error of missing phys_to_virt definition. Signed-off-by: Baoquan He <bhe@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Helge Deller <deller@gmx.de> Cc: Serge Semin <fancer.lancer@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: linux-mips@vger.kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 026246f commit aea7296

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

  • arch/mips/include/asm

arch/mips/include/asm/io.h

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,6 @@ static inline phys_addr_t virt_to_phys(const volatile void *x)
117117
return __virt_to_phys(x);
118118
}
119119

120-
/*
121-
* phys_to_virt - map physical address to virtual
122-
* @address: address to remap
123-
*
124-
* The returned virtual address is a current CPU mapping for
125-
* the memory address given. It is only valid to use this function on
126-
* addresses that have a kernel mapping
127-
*
128-
* This function does not handle bus mappings for DMA transfers. In
129-
* almost all conceivable cases a device driver should not be using
130-
* this function
131-
*/
132-
#define phys_to_virt phys_to_virt
133-
static inline void * phys_to_virt(unsigned long address)
134-
{
135-
return __va(address);
136-
}
137-
138120
/*
139121
* ISA I/O bus memory addresses are 1:1 with the physical address.
140122
*/
@@ -143,11 +125,6 @@ static inline unsigned long isa_virt_to_bus(volatile void *address)
143125
return virt_to_phys(address);
144126
}
145127

146-
static inline void *isa_bus_to_virt(unsigned long address)
147-
{
148-
return phys_to_virt(address);
149-
}
150-
151128
/*
152129
* Change "struct page" to physical address.
153130
*/
@@ -596,4 +573,9 @@ void __ioread64_copy(void *to, const void __iomem *from, size_t count);
596573

597574
#include <asm-generic/io.h>
598575

576+
static inline void *isa_bus_to_virt(unsigned long address)
577+
{
578+
return phys_to_virt(address);
579+
}
580+
599581
#endif /* _ASM_IO_H */

0 commit comments

Comments
 (0)