mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org, linux-pci@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 4/4] asm-generic/io.h: Drop ioremap_uc() stub for systems with MMU
Date: Mon, 20 Mar 2017 13:43:07 -0500	[thread overview]
Message-ID: <20170320184307.4858.40982.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20170320182014.4858.22352.stgit@bhelgaas-glaptop.roam.corp.google.com>

8c7ea50c010b ("x86/mm, asm-generic: Add IOMMU ioremap_uc() variant
default") added a default ioremap_uc() implementation that always returns
NULL to indicate failure.

For arches that don't implement their own ioremap_uc(), the default
implementation allows us to *build* drivers that use ioremap_uc(), but they
won't work.

Remove the default ioremap_uc() so a driver that depends on it will fail at
build-time rather than at run-time.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 include/asm-generic/io.h |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 3f8a7e589071..7b0617d2d210 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -798,29 +798,15 @@ static inline void *phys_to_virt(unsigned long address)
 }
 #endif
 
+#ifndef CONFIG_MMU
+
 /**
  * DOC: ioremap() and ioremap_*() variants
  *
  * If you have an MMU, your architecture must implement both ioremap() and
- * iounmap().
+ * iounmap(), as well as variants like ioremap_nocache(), ioremap_uc(),
+ * and ioremap_wc().
  *
- * It must also implement variants such as ioremap_uc().  The default
- * implementation here returns failure (NULL) to avoid improper behavior.
- */
-
-#ifdef CONFIG_MMU
-
-#ifndef ioremap_uc
-#define ioremap_uc ioremap_uc
-static inline void __iomem *ioremap_uc(phys_addr_t offset, size_t size)
-{
-	return NULL;
-}
-#endif
-
-#else /* !CONFIG_MMU */
-
-/*
  * If you don't have an MMU, the default implementations here provide
  * direct identity mapping.  You can override these if necessary.
  */

      parent reply	other threads:[~2017-03-20 18:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 18:42 [PATCH v2 0/4] ioremap() tidy-up Bjorn Helgaas
2017-03-20 18:42 ` [PATCH v2 1/4] asm-generic/io.h: Fix "IOMMU" typos Bjorn Helgaas
2017-03-20 18:42 ` [PATCH v2 2/4] asm-generic/io.h: Remove unused generic __ioremap() definition Bjorn Helgaas
2017-03-21 10:37   ` Geert Uytterhoeven
2017-03-21 19:59     ` Bjorn Helgaas
2017-03-20 18:43 ` [PATCH v2 3/4] asm-generic/io.h: Simplify ioremap() comments Bjorn Helgaas
2017-03-20 18:43 ` Bjorn Helgaas [this message]

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=20170320184307.4858.40982.stgit@bhelgaas-glaptop.roam.corp.google.com \
    --to=bhelgaas@google.com \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    /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

all inboxes | Powered by JetHome®