Skip to content

Commit 4c02add

Browse files
arndbglaubitz
authored andcommitted
sh: machvec: Remove custom ioport_{un,}map()
These functions were only used on the microdev board that is now gone, so remove them to simplify the ioport handling. This could be further simplified to use the generic I/O port accessors now. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Link: https://lore.kernel.org/r/20230914155523.3839811-4-arnd@kernel.org Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
1 parent 8daaed7 commit 4c02add

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

arch/sh/include/asm/io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
181181
{ \
182182
volatile type *__addr; \
183183
\
184-
__addr = __ioport_map(port, sizeof(type)); \
184+
__addr = (void __iomem *)sh_io_port_base + port; \
185185
*__addr = val; \
186186
slow; \
187187
} \
@@ -191,7 +191,7 @@ static inline type pfx##in##bwlq##p(unsigned long port) \
191191
volatile type *__addr; \
192192
type __val; \
193193
\
194-
__addr = __ioport_map(port, sizeof(type)); \
194+
__addr = (void __iomem *)sh_io_port_base + port; \
195195
__val = *__addr; \
196196
slow; \
197197
\

arch/sh/include/asm/machvec.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ struct sh_machine_vector {
1919
int (*mv_irq_demux)(int irq);
2020
void (*mv_init_irq)(void);
2121

22-
#ifdef CONFIG_HAS_IOPORT_MAP
23-
void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
24-
void (*mv_ioport_unmap)(void __iomem *);
25-
#endif
26-
2722
int (*mv_clk_init)(void);
2823
int (*mv_mode_pins)(void);
2924

arch/sh/kernel/ioport.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
unsigned long sh_io_port_base __read_mostly = -1;
1313
EXPORT_SYMBOL(sh_io_port_base);
1414

15-
void __iomem *__ioport_map(unsigned long addr, unsigned int size)
16-
{
17-
if (sh_mv.mv_ioport_map)
18-
return sh_mv.mv_ioport_map(addr, size);
19-
20-
return (void __iomem *)(addr + sh_io_port_base);
21-
}
22-
EXPORT_SYMBOL(__ioport_map);
23-
2415
void __iomem *ioport_map(unsigned long port, unsigned int nr)
2516
{
2617
void __iomem *ret;
@@ -29,13 +20,11 @@ void __iomem *ioport_map(unsigned long port, unsigned int nr)
2920
if (ret)
3021
return ret;
3122

32-
return __ioport_map(port, nr);
23+
return (void __iomem *)(port + sh_io_port_base);
3324
}
3425
EXPORT_SYMBOL(ioport_map);
3526

3627
void ioport_unmap(void __iomem *addr)
3728
{
38-
if (sh_mv.mv_ioport_unmap)
39-
sh_mv.mv_ioport_unmap(addr);
4029
}
4130
EXPORT_SYMBOL(ioport_unmap);

0 commit comments

Comments
 (0)