Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753976AbbGIUWR (ORCPT ); Thu, 9 Jul 2015 16:22:17 -0400 Received: from mail-bn1bbn0104.outbound.protection.outlook.com ([157.56.111.104]:24117 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753805AbbGIUWG (ORCPT ); Thu, 9 Jul 2015 16:22:06 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Roy Pledge To: , CC: , Subject: [PATCH 01/11] powerpc: re-add devm_ioremap_prot() Date: Thu, 9 Jul 2015 16:21:52 -0400 Message-ID: <1436473322-21247-2-git-send-email-Roy.Pledge@freescale.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1436473322-21247-1-git-send-email-Roy.Pledge@freescale.com> References: <1436473322-21247-1-git-send-email-Roy.Pledge@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD001;1:fTt1oh39xgWG+f0fyB+7nFvZHG/Z8vUck6fLcqX029tSwFCSpQG71PsBXfJahSp2Sc+8v2KRZxuhrnubBuPMX9wlaMkFvC0kkz4EvTQzMRsfdyYDu3i1ZkkkcmEr6NLiXNe/RbJLSSb169sg5h18vGEmWhEStYv8scu4BERBvas34w6pjeEvDggiEpLhLRaeFa/s2pQ6NI+4y6XpeC8ENzZlWBN6FtUvFu/uVapXKkv9dFQzZCp6RNNw2dAjWy8yNdTIp6zUS+HxIMoYFjxKSgF2p7+8rKMJS2fXPa851rkqvMAukwsqO3kkaoLFiGebcSmfIn2wZ0nGEsR/I9Uc0dSdGeVwokjrg1e+IJQMHrSsODU0Q2H4jr0ajdIp7vcXQfekpeQHtUyZyUKvbvF32OoY0DAznOPj5UkAqWCh1A+2gnuH8NH81m0YPSF2FO3h X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(5001960100002)(189998001)(6806004)(50986999)(87936001)(76176999)(5001770100001)(19580395003)(19580405001)(36756003)(77096005)(77156002)(62966003)(2950100001)(48376002)(229853001)(50466002)(106466001)(85426001)(92566002)(47776003)(5001920100001)(104016003)(46102003)(105606002)(50226001)(5003940100001)(86362001)(2004002)(4001450100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN3PR03MB1479;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1479;2:57rRV4/BT0ZQKvQMlYQpDmxAHH+xYblAUp0LM6FMl/lh6kv9/C6lQSramqNsj4AI;3:AcgXegPVR7lOsZmFXITe5Q6FFScMSgSqVK032xJkvGOxouKjI9OWqlrN7WS6Qh23M1dMww+EkP6pR8umE05CYqMpVe0+jBee6HwvH+IE+wO/DBHGgEow+VAW1f0gl3Jfozl3Ce1YjHuIEQ7UO1KiDB/xTQpxBhIgsRIio6/1FrXBL/oqZM9p6VRvJ55h8AlKbCY3seY+/GIwufbxhwesToFISoekgtF0dsn0vGBFrtM=;25:riS4/NDGapkFJ+C7g3FnfI16hoji/i04Mn3lXM6nAq86LtqV0HpgOuD/Ms1yAAa/QUJidu9ZFT5XCyLB6GS3wFgNwG7g0L8O5VDQTD+0KqlVDSITicCGDqydvJirvXhX0iUtM/FDe8M66H5875ohQMF5pLxRBuQ/yLlJqTDgozpYCb9YHZkpFZ0zog3449zvDgQtmw7AeEfKszIlQUjxXsCOchlt5CugArL6IlyTvbirfv+WU5l8J+0FANkrvrfs4A6scqKxrZH/Y8Z0ak12pQ==;20:11kiLCXCMKbdoTjbx+rQWMqtOyaikktYHWkmEtQw4PfiZ8c9PZXZv0IvfVPucwMfKGgxHActiOBvcux8uvEAEUB2QUy7FFHmK29KjDzTOUMFdH9kW4rrwLQeDv2PfQoPJc5xhko4DSzB2a7eU171y3rhqNKSkfrU4dJLVIu/0ZauTaDT/7uzp6cZyiS2/MgiCuuALN6IyrK/T6bQUxsTwZ/yBAMJXb91ZgtW9hffbwBHVhcBMSEqy1dbzMEmLFGxsWjHOn82rulVImFdmYEX9KiZDiIIrdHa9B56vxkAwqYzRJbW7dOi9LeQfR5QKBRFl+YtLSAQYOArUcdQjsvImCrigDoijK/h2IZWRZnZJAQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1479; 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:BN3PR03MB1479;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1479; X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1479;4:A5DhlvqPBBie1MT0uIHW6aptIoS0aYgRiX8hIHA+cxKwgaJMiFK/+RGA8uuPcJQXQUJQ77HwUYfIjZ4cUhcIaUFzBOE1LWluPkh6G9KiRlP4TGoTIJXoGc9FfT/aohCgtDT6HBULId5KJIQ6q+7EKUcx4uYsi5ZR4N2w2vI7hu/TeeyWOCU7YbgrApEcFTOk7yNhDqyzAv7tRuBAMVOusupQLQ1AuRSnFui8EDDyjEMQGixRG37pOdndm5aA8PMgPtTllbT7X7aPJJywJrufdVSbpnOeWC0XpZuX8WBH3HI= X-Forefront-PRVS: 0632519F33 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN3PR03MB1479;23:TCp+nsq6YL+coq7AD9Lmi0jwpk8Vwz8xIbI5VOf5h?= =?us-ascii?Q?X1z2SsW1noERmQyUGMOCISwbr0TlXdjE5YaEKoaDSDZGER+ObZvOwbELoDhX?= =?us-ascii?Q?77sO1O9SV1FkzrdHAAwSudIeyRrciZaKFqbs6i7Ja2RGWXTUWKx7QZxlJ3h8?= =?us-ascii?Q?H8pnPyPvaYRwn0ok8wgyMs9tDCoaBG9IMo3unkxke0WhniHh1IuFj9CnJL/r?= =?us-ascii?Q?C2lRZiCFI5UajNDgV0yPT+QV0k06RymGHMLpiFT3unuEMZj5zft86+5O/MDP?= =?us-ascii?Q?LOcIopzDayaaNS0KCn021tWzqmWnpsa09NcAqQc6SF/cNAL1Wuwso7KVSCDs?= =?us-ascii?Q?hvTTjXPdQQGR5uLg/dVBP6R9UKbd2V6UDMh9d/Layv4WXrc3mkXciRDQvtIZ?= =?us-ascii?Q?jR33bLDzimYpA5wMud6Z9+IigAmfqbZamWuYRci45WD0f1ezbqmyQboNshh4?= =?us-ascii?Q?EKU2pgtY9uG3hpxu+5qSDT+TTyoAGdBPN7WstZlEzbzMijEPA/G/z8pNgjWQ?= =?us-ascii?Q?dkCxZOlokO1M2GkbEDdVow6RFjlebM9KDCJdXBx+TDVPlTBLgJHg8P7NsPgt?= =?us-ascii?Q?H68BvGgQI0vjLMwvrrfbOscmlOiMmTs0X7SJbvqC8Qjwev3MkV+EdHCRbmUr?= =?us-ascii?Q?UC0VUnilGnXOTV3KU/0yNzWmy2F2xbQfY5iizDXcGYkWqLvCxdYpmUw9JIZe?= =?us-ascii?Q?dx7B4/swSglPrVH8AYZLTdMcMyeS/cgvN8gCXiu8JXS083vEQzC36lqTechJ?= =?us-ascii?Q?KrO7v8N81kTrJ3NsxHX6UucJ9D+wAwhZDWm0zEUaEK+XtVrViM63GYctc7om?= =?us-ascii?Q?CrjI4d65p2LZ0icyP8U/QZQuujvwCoC5dG2CmR1mikP1RmDm81NhsjjaPDCT?= =?us-ascii?Q?56BH9u8H1EhcjD7gwr/86L+8pyQH4iV4qUzcG8757voyxIp7XCAqW46Mf1UO?= =?us-ascii?Q?uFrR3Q712SIP20+K5yHge4cL8jzZvRWfX+ril2Dig=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN3PR03MB1479;5:i/zB15VY/qJ2/h/dZiVtlA+P6UlACbMWx+Hj90QHKCtr2Sqklr88b6AFkTar3YISocqhvrukZ0paENyg1migXQzcb7PoMYcO/IbUmlAxQGu+Z3ldUtWj/tgsh6BIUAMKcrCIL1uzaAKjLYaa3kfuHg==;24:t6HdKwCO+g02F4YXJfdqqLkPbmUwQUkbnHAYNCvimjHHW1eOxzBAxP9skeFpbvX5n0+zee305FKI/75Tidby4VcZekIdebwvZelD4yUULx0=;20:tqmnoK+q6t2eD+y4+P6ilCq6G+3mutdsrFxl43WSM1rp5cNEw6i33ZLZaahC6O/4d05Wl6cqiTu3kTUTn9lwww== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 20:22:04.1481 (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.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB1479 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/