From patchwork Wed Feb 22 07:44:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 9586341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A8DB2600CA for ; Wed, 22 Feb 2017 07:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 902B5285EE for ; Wed, 22 Feb 2017 07:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84F512886E; Wed, 22 Feb 2017 07:44:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 781332869D for ; Wed, 22 Feb 2017 07:44:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245AbdBVHof (ORCPT ); Wed, 22 Feb 2017 02:44:35 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33686 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754191AbdBVHo1 (ORCPT ); Wed, 22 Feb 2017 02:44:27 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OLR00J5DMTY7D40@mailout1.w1.samsung.com>; Wed, 22 Feb 2017 07:44:22 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170222074422eucas1p1472c5d0a93bcf755604575042b3cdb12~ljEDc-VGD0642906429eucas1p1_; Wed, 22 Feb 2017 07:44:22 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 1A.55.16908.8514DA85; Wed, 22 Feb 2017 07:44:24 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170222074421eucas1p17bbab9c297450bca1c5908ada16d2fa6~ljECy8qvz2900929009eucas1p1m; Wed, 22 Feb 2017 07:44:21 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-0f-58ad4158ec2f Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E8.4E.06687.AA14DA85; Wed, 22 Feb 2017 07:45:46 +0000 (GMT) Received: from AMDC2768.DIGITAL.local ([106.120.43.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OLR00HYXMTWJO00@eusync4.samsung.com>; Wed, 22 Feb 2017 07:44:21 +0000 (GMT) From: Andrzej Hajda To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij , linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [PATCH] pinctrl: samsung: Fix memory mapping code Date: Wed, 22 Feb 2017 08:44:02 +0100 Message-id: <1487749442-23806-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsWy7djPc7oRjmsjDJ6+VLO4te4cq8XGGetZ Lc6f38BuMeXPciaLzfP/MFrMOL+PyWLtkbvsFofftLNarNr1h9GB02PnrLvsHptWdbJ53Lm2 h82jb8sq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ljBItfxawQziNTBLbms+DVbEJaEr83XwTrEpE4BWjREfvXCYQh1mgj1Gi8e8q NpAqYQEriRN33rF0MXJwsAioSpxbpAwS5hVwlvj6bgEjxDo5iZvnOpknMHIvYGRYxSiSWlqc m55bbKhXnJhbXJqXrpecn7uJERiw24793LyD8dLG4EOMAhyMSjy8D9zXRAixJpYVV+YeYpTg YFYS4V1vvzZCiDclsbIqtSg/vqg0J7X4EKMp0O6JzFKiyfnAaMoriTc0MTS3NDQytrAwNzJS Euct+XAlXEggPbEkNTs1tSC1CKaPiYNTqoGxrOL/xhWMSvfVGFkPt0lbl3zUvBi7Z9WNuK59 GxRfHm9ojPojafTlXefkrT3/XLOcOG0CHLSay56+UZd/8lgterelh/X5ZRyytZbneQyj9d82 aj5Sb1hRUncy5fUhTeOuf9dzt21JnHbI8M6k9FN3WC4eOnNCx6834qvvBYtNXaFSUww3Oh9T YinOSDTUYi4qTgQAnVR0/W4CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170222074421eucas1p17bbab9c297450bca1c5908ada16d2fa6 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170222074421eucas1p17bbab9c297450bca1c5908ada16d2fa6 X-RootMTR: 20170222074421eucas1p17bbab9c297450bca1c5908ada16d2fa6 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some pinctrls share memory regions, and devm_ioremap_resource does not allow to share resources, in opposition to devm_ioremap. This patch restores back usage of devm_ioremap function, but with proper error handling and logging. Fixes: baafaca ("pinctrl: samsung: Fix return value check in samsung_pinctrl_get_soc_data()") Signed-off-by: Andrzej Hajda Tested-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index f9ddba7..ebecff8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -988,9 +988,12 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, for (i = 0; i < ctrl->nr_ext_resources + 1; i++) { res = platform_get_resource(pdev, IORESOURCE_MEM, i); - virt_base[i] = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(virt_base[i])) - return ERR_CAST(virt_base[i]); + virt_base[i] = devm_ioremap(&pdev->dev, res->start, + resource_size(res)); + if (!virt_base[i]) { + dev_err(&pdev->dev, "failed to ioremap %pR\n", res); + return ERR_PTR(-EIO); + } } bank = d->pin_banks;