Skip to content

Commit

Permalink
sh: machvec: Remove custom ioport_{un,}map()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and John Paul Adrian Glaubitz committed Oct 25, 2023
1 parent 8daaed7 commit 4c02add
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 19 deletions.
4 changes: 2 additions & 2 deletions arch/sh/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
{ \
volatile type *__addr; \
\
__addr = __ioport_map(port, sizeof(type)); \
__addr = (void __iomem *)sh_io_port_base + port; \
*__addr = val; \
slow; \
} \
Expand All @@ -191,7 +191,7 @@ static inline type pfx##in##bwlq##p(unsigned long port) \
volatile type *__addr; \
type __val; \
\
__addr = __ioport_map(port, sizeof(type)); \
__addr = (void __iomem *)sh_io_port_base + port; \
__val = *__addr; \
slow; \
\
Expand Down
5 changes: 0 additions & 5 deletions arch/sh/include/asm/machvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ struct sh_machine_vector {
int (*mv_irq_demux)(int irq);
void (*mv_init_irq)(void);

#ifdef CONFIG_HAS_IOPORT_MAP
void __iomem *(*mv_ioport_map)(unsigned long port, unsigned int size);
void (*mv_ioport_unmap)(void __iomem *);
#endif

int (*mv_clk_init)(void);
int (*mv_mode_pins)(void);

Expand Down
13 changes: 1 addition & 12 deletions arch/sh/kernel/ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,6 @@
unsigned long sh_io_port_base __read_mostly = -1;
EXPORT_SYMBOL(sh_io_port_base);

void __iomem *__ioport_map(unsigned long addr, unsigned int size)
{
if (sh_mv.mv_ioport_map)
return sh_mv.mv_ioport_map(addr, size);

return (void __iomem *)(addr + sh_io_port_base);
}
EXPORT_SYMBOL(__ioport_map);

void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
void __iomem *ret;
Expand All @@ -29,13 +20,11 @@ void __iomem *ioport_map(unsigned long port, unsigned int nr)
if (ret)
return ret;

return __ioport_map(port, nr);
return (void __iomem *)(port + sh_io_port_base);
}
EXPORT_SYMBOL(ioport_map);

void ioport_unmap(void __iomem *addr)
{
if (sh_mv.mv_ioport_unmap)
sh_mv.mv_ioport_unmap(addr);
}
EXPORT_SYMBOL(ioport_unmap);

0 comments on commit 4c02add

Please sign in to comment.