Linux 6.13-rc4
[linux.git] / arch / sh / kernel / ioport.c
blobc8aff8a20164d3c9837b9e9ba41453d294e82f5f
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * arch/sh/kernel/ioport.c
5 * Copyright (C) 2000 Niibe Yutaka
6 * Copyright (C) 2005 - 2007 Paul Mundt
7 */
8 #include <linux/module.h>
9 #include <linux/io.h>
10 #include <asm/io_trapped.h>
12 unsigned long sh_io_port_base __read_mostly = -1;
13 EXPORT_SYMBOL(sh_io_port_base);
15 void __iomem *ioport_map(unsigned long port, unsigned int nr)
17 void __iomem *ret;
19 ret = __ioport_map_trapped(port, nr);
20 if (ret)
21 return ret;
23 return (void __iomem *)(port + sh_io_port_base);
25 EXPORT_SYMBOL(ioport_map);
27 void ioport_unmap(void __iomem *addr)
30 EXPORT_SYMBOL(ioport_unmap);