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: 9738673 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 29DF16034C for ; Sat, 20 May 2017 16:03:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1855C284F3 for ; Sat, 20 May 2017 16:03:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AA4228643; Sat, 20 May 2017 16:03:32 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18EAB284F3 for ; Sat, 20 May 2017 16:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=7+F5tdZ33IMQCKgRnelCfXVTqubs5PqE2oTqzeUVxGY=; b=Q6Z v8Y3eyD3qBdSUKarrnNpwi1ze+7ULzEcLUbB33BHw7j0e9scL3THhZHB7BfZ1SxzYFe+HcCRT2jwT ttnz85h6S4ebDLyjvTl2U5hMmKEDJStbqtOg5vPaSeYA4YAXHFSsOfEQvGHcK8kK1BrG66Tykq68y YBHmeLO77IwCMo+QMrsFTSD85KzXUqVfvGBuMm9PZhljLsUEemwPCWgDDzF9dEjcwZsiyUwkwP/gL ql1uzApEdsTurgi6OqA2ZccPWyFYWyUJhYsWAClyRFLIq9qqClhvy+KHbWPlBvB8ZCIPa/wWER+5Z NxBGZv3Vk3TiZDVI+iVDJz/CuQOmLlw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dC6qn-0006At-Ir; Sat, 20 May 2017 16:03:29 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dC6qi-00068e-PE for linux-arm-kernel@lists.infradead.org; Sat, 20 May 2017 16:03:26 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170520_090325_194390_3F0D6F6A X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tony Lindgren , Linus Walleij , linux-kernel@vger.kernel.org, Masahiro Yamada , Haojian Zhuang , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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));