From patchwork Tue Jan 17 12:44:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 91631 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp470451qgi; Tue, 17 Jan 2017 04:46:16 -0800 (PST) X-Received: by 10.84.217.216 with SMTP id d24mr58351422plj.101.1484657176395; Tue, 17 Jan 2017 04:46:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k63si8497668pfj.144.2017.01.17.04.46.16; Tue, 17 Jan 2017 04:46:16 -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 S1751194AbdAQMqM (ORCPT + 4 others); Tue, 17 Jan 2017 07:46:12 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:27653 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbdAQMqE (ORCPT ); Tue, 17 Jan 2017 07:46:04 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OJX005Y0CR2DW60@mailout4.w1.samsung.com>; Tue, 17 Jan 2017 12:45:02 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p1bc0f107ebfb82aad9b51159f81d588fb~aj8ShS3QH2650526505eucas1p1l; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id E8.66.17477.DC11E785; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170117124501eucas1p101d1468371db26b0244854e36281b9c9~aj8R7DJD71175611756eucas1p1V; Tue, 17 Jan 2017 12:45:01 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-83-587e11cd0d98 Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E8.A5.06687.6021E785; Tue, 17 Jan 2017 12:45:58 +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 <0OJX00GNRCQPHB20@eusync2.samsung.com>; Tue, 17 Jan 2017 12:45: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 v2 09/13] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Tue, 17 Jan 2017 13:44:40 +0100 Message-id: <1484657084-26227-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1484657084-26227-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7pnBesiDFomq1psnLGe1eL8+Q3s FlP+LGey2PT4GqvF5vl/GC0+9x5htJhxfh+Txdojd9ktDr9pZ7VYtesPowOXx85Zd9k9Nq3q ZPO4c20Pm8fmJfUefVtWMXp83iQXwBbFZZOSmpNZllqkb5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TcBQouttF1iViEAzo0TDkl4w h1lgApPEzE8NTCBVwgKREpcadoDNZRFQlTj4ZgaYzSvgKfH/8CJGiH1yEiePTQaLcwLFf/xc D9YrJOAhcf7+PtYJjLwLGBlWMYqklhbnpucWG+oVJ+YWl+al6yXn525iBAb9tmM/N+9gvLQx +BCjAAejEg+vw+2aCCHWxLLiytxDjBIczEoivHMF6iKEeFMSK6tSi/Lji0pzUosPMZoCHTWR WUo0OR8YkXkl8YYmhuaWhkbGFhbmRkZK4rwlH66ECwmkJ5akZqemFqQWwfQxcXBKNTD2HTj/ wDp+6v7He82Cm99lKmvHnZq6/oOZqGuNfceDzn6zi+eSL0dVcogltGYu2RrKVPbJVioxZcp1 1xip3Q/8lsT/evVVazubt5Sxd4uY9OPoGRM8te7lbJox6dyDPyFLai5bBm/e4p+ps9OWM2DH 7gn+x5vZnptp6BV3zrS11JI+O6te/qASS3FGoqEWc1FxIgCTfKctkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 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: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 X-RootMTR: 20170117124501eucas1p101d1468371db26b0244854e36281b9c9 References: <1484657084-26227-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 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;