From patchwork Sat May 20 16:02:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9738677 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 C61996034C for ; Sat, 20 May 2017 16:09:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6A5028544 for ; Sat, 20 May 2017 16:09:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A93C128644; Sat, 20 May 2017 16:09:14 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 2EE5328544 for ; Sat, 20 May 2017 16:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755068AbdETQJM (ORCPT ); Sat, 20 May 2017 12:09:12 -0400 Received: from condef-05.nifty.com ([202.248.20.70]:53289 "EHLO condef-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754981AbdETQJL (ORCPT ); Sat, 20 May 2017 12:09:11 -0400 Received: from conuserg-08.nifty.com ([10.126.8.71])by condef-05.nifty.com with ESMTP id v4KG3Wrl024126; Sun, 21 May 2017 01:03:32 +0900 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-08.nifty.com with ESMTP id v4KG2Qpl014040; Sun, 21 May 2017 01:02:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v4KG2Qpl014040 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1495296154; bh=zup9bbj9zEV6zIsG9ofc1LNJB4KufEgfm6sddQcoqvs=; h=From:To:Cc:Subject:Date:From; b=wO3z50/rr6wjD9Jq+90gZtCMZ3mf1y17a7vLmJIVw9HiQTZjp7XiHnkQMWzSLfNeA 5dYk6OKi8DfTHEt9mt81oPIfMFI+3MUXAm3OUr8vXyerH+ihRyk/HHTOXDWenKtX64 kvKnNYQK5wgCLWzv4LnO7GWkiLXtTQiWeOSPOxws12ixpCIqxg0/bloJ2H9W67cOik TAsavWysLfIo3DsoqgKwSpnXq02qBAiSRGq/s5hJvRz8hbL680F0cKruQJX3y0H33L 6aMEkU4F3VPHFCUw1VKpnZPxDDO/2J+RAGyKB4KUVE9j8BPkRFIRIpL/wZWMskXo78 +RlPOlNaSmh7w== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-gpio@vger.kernel.org Cc: Masahiro Yamada , Linus Walleij , linux-kernel@vger.kernel.org, Tony Lindgren , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Haojian Zhuang Subject: [PATCH] pinctrl: single: use of_device_get_match_data() to get soc data Date: Sun, 21 May 2017 01:02:17 +0900 Message-Id: <1495296137-6461-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use of_device_get_match_data() instead of of_match_device(). It allows us to remove the forward declaration of pcs_of_match. Signed-off-by: Masahiro Yamada Acked-by: Tony Lindgren --- drivers/pinctrl/pinctrl-single.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 9c267dc..b8b3d93 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1270,8 +1270,6 @@ static void pcs_free_resources(struct pcs_device *pcs) #endif } -static const struct of_device_id pcs_of_match[]; - static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs) { const char *propname = "pinctrl-single,gpio-range"; @@ -1637,15 +1635,14 @@ static int pcs_quirk_missing_pinctrl_cells(struct pcs_device *pcs, static int pcs_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct pcs_pdata *pdata; struct resource *res; struct pcs_device *pcs; const struct pcs_soc_data *soc; int ret; - match = of_match_device(pcs_of_match, &pdev->dev); - if (!match) + soc = of_device_get_match_data(&pdev->dev); + if (WARN_ON(!soc)) return -EINVAL; pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL); @@ -1658,7 +1655,6 @@ static int pcs_probe(struct platform_device *pdev) raw_spin_lock_init(&pcs->lock); mutex_init(&pcs->mutex); INIT_LIST_HEAD(&pcs->gpiofuncs); - soc = match->data; pcs->flags = soc->flags; memcpy(&pcs->socdata, soc, sizeof(*soc));