From patchwork Mon Jan 16 06:45:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9518167 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 2158B601B7 for ; Mon, 16 Jan 2017 06:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFDB02838C for ; Mon, 16 Jan 2017 06:46:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D49BF283CB; Mon, 16 Jan 2017 06:46:03 +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 83C5E2838C for ; Mon, 16 Jan 2017 06:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbdAPGqC (ORCPT ); Mon, 16 Jan 2017 01:46:02 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59749 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751355AbdAPGpc (ORCPT ); Mon, 16 Jan 2017 01:45:32 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJV007R61FSAI50@mailout1.w1.samsung.com>; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170116064528eucas1p2f38a40e056a14f693f63d5ade44503f3~aLZEDepU52675826758eucas1p2s; Mon, 16 Jan 2017 06:45:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 45.26.30614.70C6C785; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1~aLZDTr1gF1341013410eucas1p1H; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-87-587c6c07d603 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id B7.9B.06687.F3C6C785; Mon, 16 Jan 2017 06:46:23 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OJV00BS81FJUN70@eusync2.samsung.com>; Mon, 16 Jan 2017 06:45:27 +0000 (GMT) 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 , Bartlomiej Zolnierkiewicz Subject: [PATCH 08/12] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Mon, 16 Jan 2017 07:45:03 +0100 Message-id: <1484549107-5957-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7rsOTURBl9/aVpsnLGe1eL8+Q3s FlP+LGey2P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Jtq qxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsEt4xlv/+xFxzjrdg94wZzA+Nu7i5GTg4JAROJ 1e+Os0DYYhIX7q1n62Lk4hASWMIoMefYIVYIp4lJYvXhOWwgVWwChhJdb7vAqkQEmhklGpb0 gjnMAhOYJGZ+amACqRIWCJPYtfIlI4jNIqAqcfTCBXYQm1fAXeJY+wGofXISJ49NZgWxOQU8 JCbuawWLCwHVzHg1lXkCI+8CRoZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgWG/7djPzTsY L20MPsQowMGoxMP7Y1d1hBBrYllxZe4hRgkOZiURXrfMmggh3pTEyqrUovz4otKc1OJDjKZA R01klhJNzgfGZF5JvKGJobmloZGxhYW5kZGSOG/JhyvhQgLpiSWp2ampBalFMH1MHJxSDYwZ hjXdq3bYxn67fnXju9JXkTN9Qo49ZdNZ1J5gJKjNpHLmBF9jtOmB20Xb7VcltD4qFW/5cUBo Gbf/jyCBLa+/9JqKzZ70JTzcyZnxxLxFO4N8Zxe+57zncWvD2vdOTZdrDqg6TU88/E6Gxbi8 yVeITTqvc8fBjyce5NVbVWVseGVx8sd8iVQlluKMREMt5qLiRACNtXLekQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 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: 201P X-HopCount: 7 X-CMS-RootMailID: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 X-RootMTR: 20170116064527eucas1p1950a217ba6563a443bb44e8e87cc26b1 References: <1484549107-5957-1-git-send-email-m.szyprowski@samsung.com> 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 Replace custom code with generic helper. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 7648a280c0f4..86f23842f681 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 @@ -955,15 +956,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; @@ -978,8 +977,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;