From patchwork Thu Jan 26 09:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92502 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96237qgi; Thu, 26 Jan 2017 01:30:20 -0800 (PST) X-Received: by 10.98.214.209 with SMTP id a78mr2040552pfl.6.1485423020319; Thu, 26 Jan 2017 01:30:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.20; Thu, 26 Jan 2017 01:30:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753319AbdAZJaR (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:26843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbdAZJaG (ORCPT ); Thu, 26 Jan 2017 04:30:06 -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 <0OKD00611RQ21G70@mailout1.w1.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p2b8fc96dc87a4073e224be37853f43623~dSFmbShmB1108211082eucas1p2X; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id C2.7D.28517.991C9885; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00~dSFlxNW4I0738807388eucas1p2k; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-18-5889c199caa4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8B.FC.06687.9D1C9885; Thu, 26 Jan 2017 09:31:05 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:01 +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 v3 REBASED 09/13] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Thu, 26 Jan 2017 10:29:23 +0100 Message-id: <1485422967-30643-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7ozD3ZGGKxdpWixccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFsUl01Kak5mWWq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ZIg9hsAoYSXW+7wIpEBJoZJRqW 9II5zAITmCRmfmoAGyUskCjx7fU+MJtFQFXidEM3O4jNK+AhMfvwBzaIdXISJ49NZgWxOQU8 JfY3bWOH2DaRUeLo7OwJjLwLGBlWMYqklhbnpucWG+oVJ+YWl+al6yXn525iBAb9tmM/N+9g vLQx+BCjAAejEg/vgR0dEUKsiWXFlbmHGCU4mJVEeA/t64wQ4k1JrKxKLcqPLyrNSS0+xGgK dNREZinR5HxgROaVxBuaGJpbGhoZW1iYGxkpifOWfLgSLiSQnliSmp2aWpBaBNPHxMEp1cDI MEOgcefxcMsDUrcmnzUx3NbPuDiHdZGCctYHQ+c9iyyn/5+ybuWVXE+nM3Usb8okheUKM7Pd fjX5HFapNf0WcEB35WX/xFPT//i49Ectdt9/ZMe0r/U1z3jnnd3DNMMzxmtBwSr7wBnVd566 197vYDlz2etizUZh3uiJyRPKJe1Kd210+WetxFKckWioxVxUnAgAYTUylpACAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 X-RootMTR: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 References: <1485422967-30643-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 Replace custom code with generic helper. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 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 2803ae57f373..59f99ea7e65b 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,12 @@ 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; struct device_node *node = pdev->dev.of_node; struct device_node *np; const struct samsung_pin_bank_data *bdata; @@ -978,8 +976,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; + ctrl = of_device_get_match_data(&pdev->dev); + ctrl += id; d->suspend = ctrl->suspend; d->resume = ctrl->resume;