Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940AbbHLUPH (ORCPT ); Wed, 12 Aug 2015 16:15:07 -0400 Received: from mail-bn1on0111.outbound.protection.outlook.com ([157.56.110.111]:24529 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751776AbbHLUPC (ORCPT ); Wed, 12 Aug 2015 16:15:02 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Roy Pledge To: , CC: , Subject: [v2 01/11] powerpc: re-add devm_ioremap_prot() Date: Wed, 12 Aug 2015 16:14:47 -0400 Message-ID: <1439410497-19039-2-git-send-email-Roy.Pledge@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439410497-19039-1-git-send-email-Roy.Pledge@freescale.com> References: <1439410497-19039-1-git-send-email-Roy.Pledge@freescale.com> Reply-To: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD047;1:oCK4ZpcI4V4DYsPC3iwgb392MrGuVH0s+A35qv0dTL28wJjw+WcTPdL7hL2G5c/bxcQSEE4w7bD8uk7QAP7v8n9//xcI+mgNh4UTxK16vkok/fTbCX/pJAwXTIt0c+hwsG4SI8ZkMdkPjqPmbSRjJjA/IrpYAHD7t9QT480rCHSfADP73AGlUgayhNgdXph//GTpVu1aosyeg/Jg4oN8snQ5atIDLdTRX3fS8K2EED/1c7KCuDr5lS/p0H5WpX+1RraTYnPM7/GeHV8Rz5Gp6kzVTm7te5b0YGfLmRw9RzjgQsS5Y/U506ldsPWKHnuuOi8iiPrgGHLg5ih5o7y0Um99ffiQDcbki5r62R8ccE3gCPK1ezcagGuujMfkgkn2pvGeXEgNzqMlIuRgOM58Og== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(199003)(189002)(5001960100002)(50466002)(104016003)(48376002)(189998001)(64706001)(4001540100001)(6806004)(76176999)(53806999)(5001770100001)(5001860100001)(97736004)(19580405001)(5001830100001)(19580395003)(81156007)(50986999)(47776003)(4001450100002)(77096005)(68736005)(5003940100001)(87936001)(106466001)(2950100001)(43066003)(86362001)(46102003)(229853001)(50226001)(105606002)(69596002)(85426001)(62966003)(77156002)(36756003)(2004002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1478;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1478;2:c68E68FXcWc/ZI7wC8sf2CNkeN8JQ1iXub6CooU5RVkFFdBtZsctJ0DlCBBVJZjFY8jF6gcyH5+COG8ZNq1o3bQVhz3rf7nLDy7alcU7W7OJBqt8aN0qdi1AN1ypSCgdMRRG952SgXKHOsAUow7JnVqxAJXc7E9WwkwQ2ejOix4=;3:MjBymFHSG7Fc6gH8ptP2gn+WgC1h6b5skEK447IJE4F/Jht8xQOMpD2rTr5W2u2snf2cPUKsJXM2zcujIH1xi4BR0gXRX1+qkKyhu35RbGs0mqpI4fqHd6y1O/lbx8l0JulFZ9JBF+a1gVm48YKve28Fgwfkr7B+X0dD4/RyUIZSGM0AyeL9ovO+HeKtuNvjndQYK5V6zX1Z3NC0HxzvB1yH376OvSbdk/1iP5+PsGg=;25:QXmOyBcVx12G6GqWPWtlLZ8xdp6cGpJLOsVvqFE6z1ciJgHvxQ0Xn9fOzUhcFbV/xlTATpy8iXYYuCn4PLvEYmGq/YowMpfLqqi8bNkMPhZagLHZ52u9DD9HFJ4fcD3l+SRALtjKKUY3bqbpJBkNqPNKI/qdhKd7BoERiRHs2uxogxmolf61i2gO0QAo5t7Y+eWI37dwSZZo8aNfx83j+HBS4ip4KC/oHZhYC8YHOJP7B7z3eJi7at+XSfzybIWK3GgIihvC6F2JT6x6gFvIkQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1478; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1478;20:LA0OyBI3u0kPUpP9gNS3c8fxVmtT2RZEf38aeKwpVL3poW3XXE/FgPPyhlIuyT9hadEQNlJc2Ykjs1Gsde18IuDZ440rJeQ5QyEeZS7r2tip3yV757Bh2CdIY15B1GB5RY9yafKHL0Ap8c6RIAOBFnBRryTQefMeFvRe4C9zA946n1wewSo4IJdhcbd79C5Y0rQo4BseYXkKyCxTqV1yqKgD+q4cQuUKWk1jFlYKW6Ox6A5UKA9AVFbltVdQ9I9mATzRZljxJWoX7vObNnR3dsLPL0w4+hhlCNPwOw/09vjOVNGHiTb43D9WeRZy41TM5HL1V59OzyR4W65CWTEYTafZzESCJ6GEC2wGt+xkXzI=;4:pACQxnnTQLTOxDYfXK+aE+Ry6cXYWeqsTQP2gurd9r/kbVpjl6LlNYpqA6QEKd90UUyBDMZtWbMXc0FEKUS2Lb9hNiRkDihy2DdGVK0lSwomLs/cXb2HG1RSU1i5TwwMjPyJnmPOIqBSfyIQc+qIveeTw796runP6VQdN0sa+Cv2MDnRHSXTvPJkT+b9Hc9F2K+98u6TDfsWYf2nTEptDtpWA1lgBfag8yuDH6i+sKyHk/wcHxKYvnzhGLePHXtAkN/aOgk/d/VA3X6jKQ0ZVyWYs2dfB2peTGzWOwwbn2A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN3PR03MB1478;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1478; X-Forefront-PRVS: 0666E15D35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR03MB1478;23:18okw/ZQs/rjaTahWzyfv1e1vhm9LgCu7S1K3jHEp?= =?us-ascii?Q?CU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0UYZfUfbG8O0FT+rr9?= =?us-ascii?Q?6k+SZcJ3whTR/CoisXk4dY9urcjia5WmFgVWDsmcehgCsXicMQwHhso0prPT?= =?us-ascii?Q?jmD5C8w7N9EVjjgpEzcKLjtelBpsMDhhZRwc7BvHCcPiQ1SsPiVoK8v2cgbh?= =?us-ascii?Q?rJ6fyi8UeslZSInBh6aFJXogIQA5vZttULQLGQH+7gNqtIkgTHRybqn3mj2L?= =?us-ascii?Q?Qx+xB3ZkJ/noEM3lBCY5hJNVp6koiGOmhvEbR88KVBRSwXJ+hsNNOXz0cq//?= =?us-ascii?Q?Z5D73Yc2fmzCOe3Cb86VKPtyqM9lNkn3Sn5?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1478;5:HH/YSCkA9uv0W4jizhc7RBk2TVgcUwvizTrI7Oly8fpptR3FEh4iJG6DUCmtW5tlKGxkc8B5L8F4TXonb/yEtcxL8ZlMiYk8/ZKTgBAV72BfWrgsI6cvf3rXpQh0ONfFDlFpHFdQzTdO5LkMOoKqdA==;24:pg4sqkHzEG3T/+BUkKh44vXyATFV7+C/T9zSAdYwY1maDyQLavCiC/Y1B6Kq4eeLNub4p5GAJEYDO1EKKcsTDK0B+r02z3dVSt6RagzKvKI=;20:Eh8CF0sIyStRHDi+UUwU01AfpHPxEWw1kU3EmdA/4Vb8xbGUDY4Q2O14ilS01qOyTPgei+qQGy0cSxi9WcfNvg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2015 20:14:59.6067 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1478 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3163 Lines: 98 From: Emil Medve devm_ioremap_prot() was removed in commit dedd24a12, and was introduced in commit b41e5fffe8. This reverts commit dedd24a12fe6735898feeb06184ee346907abb5d. Signed-off-by: Emil Medve --- arch/powerpc/include/asm/io.h | 3 +++ arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/devres.c | 43 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 arch/powerpc/lib/devres.c diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index a8d2ef3..9eaf301 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -855,6 +855,9 @@ static inline void * bus_to_virt(unsigned long address) #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set) +void __iomem *devm_ioremap_prot(struct device *dev, resource_size_t offset, + size_t size, unsigned long flags); + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_IO_H */ diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index a47e142..7ae60f0 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile @@ -13,6 +13,7 @@ obj-y += string.o alloc.o crtsavres.o ppc_ksyms.o code-patching.o \ feature-fixups.o obj-$(CONFIG_PPC32) += div64.o copy_32.o +obj-$(CONFIG_HAS_IOMEM) += devres.o obj64-y += copypage_64.o copyuser_64.o usercopy_64.o mem_64.o hweight_64.o \ copyuser_power7.o string_64.o copypage_power7.o memcpy_power7.o \ diff --git a/arch/powerpc/lib/devres.c b/arch/powerpc/lib/devres.c new file mode 100644 index 0000000..8df55fc --- /dev/null +++ b/arch/powerpc/lib/devres.c @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008 Freescale Semiconductor, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include /* devres_*(), devm_ioremap_release() */ +#include +#include /* ioremap_prot() */ +#include /* EXPORT_SYMBOL() */ + +/** + * devm_ioremap_prot - Managed ioremap_prot() + * @dev: Generic device to remap IO address for + * @offset: BUS offset to map + * @size: Size of map + * @flags: Page flags + * + * Managed ioremap_prot(). Map is automatically unmapped on driver + * detach. + */ +void __iomem *devm_ioremap_prot(struct device *dev, resource_size_t offset, + size_t size, unsigned long flags) +{ + void __iomem **ptr, *addr; + + ptr = devres_alloc(devm_ioremap_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return NULL; + + addr = ioremap_prot(offset, size, flags); + if (addr) { + *ptr = addr; + devres_add(dev, ptr); + } else + devres_free(ptr); + + return addr; +} +EXPORT_SYMBOL(devm_ioremap_prot); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/