linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org, Rich Felker <dalias@libc.org>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 4/4] sh: machvec: remove custom ioport_{un,}map()
Date: Wed,  2 Aug 2023 20:48:49 +0200	[thread overview]
Message-ID: <20230802184849.1019466-4-arnd@kernel.org> (raw)
In-Reply-To: <20230802184849.1019466-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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>
---
 arch/sh/include/asm/io.h      |  4 ++--
 arch/sh/include/asm/machvec.h |  5 -----
 arch/sh/kernel/ioport.c       | 13 +------------
 3 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index f2f38e9d489ac..ac521f287fa59 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -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;								\
 }									\
@@ -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;								\
 									\
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
index 2b4b085e8f219..4e5314b921f19 100644
--- a/arch/sh/include/asm/machvec.h
+++ b/arch/sh/include/asm/machvec.h
@@ -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);
 
diff --git a/arch/sh/kernel/ioport.c b/arch/sh/kernel/ioport.c
index f39446a658bdb..c8aff8a20164d 100644
--- a/arch/sh/kernel/ioport.c
+++ b/arch/sh/kernel/ioport.c
@@ -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;
@@ -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);
-- 
2.39.2


  parent reply	other threads:[~2023-08-02 18:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 18:48 [PATCH 1/4] sh: remove stale microdev board Arnd Bergmann
2023-08-02 18:48 ` [PATCH 2/4] sh: remove unused sh4-202 support Arnd Bergmann
2023-09-08 10:00   ` John Paul Adrian Glaubitz
2023-08-02 18:48 ` [PATCH 3/4] sh: remove superhyway bus support Arnd Bergmann
2023-08-03  7:58   ` D. Jeff Dionne
2023-08-03  8:44     ` John Paul Adrian Glaubitz
2023-08-03  9:19       ` Arnd Bergmann
2023-08-03  9:36         ` John Paul Adrian Glaubitz
2023-08-03  9:58           ` Arnd Bergmann
2023-09-08 10:02   ` John Paul Adrian Glaubitz
2023-08-02 18:48 ` Arnd Bergmann [this message]
2023-09-08 10:10   ` [PATCH 4/4] sh: machvec: remove custom ioport_{un,}map() John Paul Adrian Glaubitz
2023-09-08 10:20     ` Geert Uytterhoeven
2023-09-08 10:21       ` John Paul Adrian Glaubitz
2023-09-08 10:23   ` John Paul Adrian Glaubitz
2023-09-13 12:32   ` Geert Uytterhoeven
2023-09-13 14:08     ` Arnd Bergmann
2023-09-13 14:13       ` Geert Uytterhoeven
2023-09-13 14:30         ` Arnd Bergmann
2023-09-14  6:23           ` John Paul Adrian Glaubitz
2023-09-14 15:56             ` Arnd Bergmann
2023-09-15 15:41           ` Geert Uytterhoeven
2023-09-15 15:49             ` Arnd Bergmann
2023-09-21  7:45               ` John Paul Adrian Glaubitz
2023-09-21  8:52                 ` Geert Uytterhoeven
2023-09-25  7:08                   ` Yoshinori Sato
2023-09-25  7:36                     ` Arnd Bergmann
2023-09-26 22:15                     ` John Paul Adrian Glaubitz
2023-09-08  9:59 ` [PATCH 1/4] sh: remove stale microdev board John Paul Adrian Glaubitz
2023-09-09 22:06 ` John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230802184849.1019466-4-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=dalias@libc.org \
    --cc=geert+renesas@glider.be \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).