From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932105AbbGTAY0 (ORCPT ); Sun, 19 Jul 2015 20:24:26 -0400 Received: from mga02.intel.com ([134.134.136.20]:20209 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755134AbbGTAYW (ORCPT ); Sun, 19 Jul 2015 20:24:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,505,1432623600"; d="scan'208";a="765660507" Subject: [PATCH 08/10] arch: introduce strict_ioremap From: Dan Williams To: tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com Cc: linux-arch@vger.kernel.org, tony.luck@intel.com, linux@arm.linux.org.uk, arnd@arndb.de, benh@kernel.crashing.org, mcgrof@suse.com, x86@kernel.org, linux-kernel@vger.kernel.org, ralf@linux-mips.org, geert@linux-m68k.org, toshi.kani@hp.com, ross.zwisler@linux.intel.com, hch@lst.de, linux-arm-kernel@lists.infradead.org Date: Sun, 19 Jul 2015 20:18:17 -0400 Message-ID: <20150720001817.30857.69287.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20150720001614.30857.89063.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20150720001614.30857.89063.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for enabling memremap(), add support for strict mappings. strict_ioremap_() returns NULL if the arch does not implement the mapping type, rather than falling back silently to ioremap(). Signed-off-by: Dan Williams --- include/linux/io.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/io.h b/include/linux/io.h index 58482241c95c..080a4fbf2ba4 100644 --- a/include/linux/io.h +++ b/include/linux/io.h @@ -130,6 +130,27 @@ static inline void __iomem *ioremap_uc(resource_size_t offset, } #endif +static inline void __iomem *strict_ioremap_cache(resource_size_t offset, + unsigned long size) +{ +#ifdef ioremap_cache + return ioremap_cache(offset, size); +#else + return (void __force __iomem *) NULL; +#endif +} + +static inline void __iomem *strict_ioremap_wt(resource_size_t offset, + unsigned long size) +{ +#ifdef ioremap_wt + return ioremap_wt(offset, size); +#else + return (void __force __iomem *) NULL; +#endif +} + + /* * Some systems do not have legacy ISA devices. * /dev/port is not a valid interface on these systems.