From patchwork Fri Dec 23 12:24:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 88943 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp3296307qgi; Fri, 23 Dec 2016 04:25:43 -0800 (PST) X-Received: by 10.99.108.8 with SMTP id h8mr25076610pgc.93.1482495943179; Fri, 23 Dec 2016 04:25:43 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67si34013481pfb.71.2016.12.23.04.25.43; Fri, 23 Dec 2016 04:25:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941579AbcLWMZm (ORCPT + 4 others); Fri, 23 Dec 2016 07:25:42 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:45365 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941354AbcLWMZj (ORCPT ); Fri, 23 Dec 2016 07:25:39 -0500 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OIN02H6Q16G1QB0@mailout1.samsung.com>; Fri, 23 Dec 2016 21:25:28 +0900 (KST) Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20161223122528epcas1p4ecf08987fc7e911f2d7248f7a83e6519~S4jEisrs41538915389epcas1p4J; Fri, 23 Dec 2016 12:25:28 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id E3.74.12664.7B71D585; Fri, 23 Dec 2016 21:25:27 +0900 (KST) Received: from epcpsbgm1new.samsung.com (u26.gpu120.samsung.co.kr [203.254.230.26]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20161223122527epcas1p441f0ee34c5738645163ef40c94591183~S4jEUN9Vw0399403994epcas1p4t; Fri, 23 Dec 2016 12:25:27 +0000 (GMT) X-AuditID: b6c32a36-f790e6d000003178-75-585d17b72c49 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 73.21.28252.7B71D585; Fri, 23 Dec 2016 21:25:27 +0900 (KST) Received: from AMDC2765.digital.local ([106.116.147.25]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OIN00JTK15R7DD0@mmp2.samsung.com>; Fri, 23 Dec 2016 21:25:27 +0900 (KST) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Ulf Hansson , Bartlomiej Zolnierkiewicz Subject: [PATCH 4/9] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Fri, 23 Dec 2016 13:24:44 +0100 Message-id: <1482495889-6201-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1482495889-6201-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMIsWRmVeSWpSXmKPExsWy7bCmnu528dgIg7+XbSw2zljPanH+/AZ2 iyl/ljNZbHp8jdVi8/w/jBafe48wWsw4v4/JYu2Ru+wWh9+0s1qs2gWUOL423IHbY+esu+we m1Z1snncubaHzWPzknqPvi2rGD0+b5ILYIvisklJzcksSy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3sCo2AUOJrrddYAkRgWZGiYYl vWAOs8AOJonJZ9cwg1QJC4RIvNr/nQ3EZhFQlVh0dhsriM0r4C6xY2E3C8Q+OYmTxyaDxTkF PCS2bnjFDmILAdVc2P6QfQIj7wJGhlWMEqkFyQXFSem5hnmp5XrFibnFpXnpesn5uZsYwXHw TGoH48Fd7ocYBTgYlXh4T5yNiRBiTSwrrsw9xCjBwawkwjtFODZCiDclsbIqtSg/vqg0J7X4 EKMp0GETmaVEk/OBMZpXEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZqakFqEUwfEwen VAOjqGyH2VllBqZy9pjlf2/We+S++cZ4nTNv1/4Dx6JepBtJ8cwocuzKbrx/sO3/jLCVzTfv 7c7ydTm65ZapSgkb1zF10zAHFZuiqjaGonCG01I8UfMqI9bkRhhddfdzqNmm73LqzXzvDe9C 7yzYqKgVvWLTtC3OC+cZTdbZcvWF29IJt2sMHsYpsRRnJBpqMRcVJwIAe1qVA5kCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161223122527epcas1p441f0ee34c5738645163ef40c94591183 X-Msg-Generator: CA X-Sender-IP: 203.254.230.26 X-Local-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRs=?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?TWFyZWsgU3p5cHJvd3NraRtTUlBPTC1LZXJuZWwgKFRQKRtT?= =?UTF-8?B?YW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 101P X-HopCount: 7 X-CMS-RootMailID: 20161223122527epcas1p441f0ee34c5738645163ef40c94591183 X-RootMTR: 20161223122527epcas1p441f0ee34c5738645163ef40c94591183 References: <1482495889-6201-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Replace custom code with generic helper. Signed-off-by: Marek Szyprowski --- drivers/pinctrl/samsung/pinctrl-samsung.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 4d9262051ff1..a6c2ea74e0f3 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -967,15 +968,13 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, return 0; } -static const struct of_device_id samsung_pinctrl_dt_match[]; - /* retrieve the soc specific data */ static const struct samsung_pin_ctrl * samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, struct platform_device *pdev) { int id; - const struct of_device_id *match; + const struct samsung_pin_ctrl *match_data; struct device_node *node = pdev->dev.of_node; struct device_node *np; const struct samsung_pin_bank_data *bdata; @@ -990,8 +989,8 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, dev_err(&pdev->dev, "failed to get alias id\n"); return ERR_PTR(-ENOENT); } - match = of_match_node(samsung_pinctrl_dt_match, node); - ctrl = (struct samsung_pin_ctrl *)match->data + id; + match_data = of_device_get_match_data(&pdev->dev); + ctrl = match_data + id; d->suspend = ctrl->suspend; d->resume = ctrl->resume;