From patchwork Wed Aug 9 09:18:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 9889963 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 1B17E602D7 for ; Wed, 9 Aug 2017 09:30:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0938628A4F for ; Wed, 9 Aug 2017 09:30:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1F3128A5A; Wed, 9 Aug 2017 09:30:20 +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, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY 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 B2D7A28A4F for ; Wed, 9 Aug 2017 09:30:20 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=4WQZr6Oc3ozVs5+2sFAn2xenP6x1MRSAlFVU+tOLWEw=; b=Tjy7buga9IL4ud GIhVQPiSla2bXS9At8Jhhdfw8EsRetpmYlYg1VAwWhocZ0HpWl2TBcHMyeCXAxqSHErKB+KSsKiTy JC04bzCnh6ifzjSnPz6ypKwoXhxYYl8faktq77dYkCGqVAU2NzcO10vPjSQGSGUyw33wlomQe+Gbb XgIeTYwdVd04pWDMVyVGwGLlfWJrgrHd2BBAZ2EFbcEPR+38naoqbpQExzorhpMQ6Dr7YrrcWJ/zt I2awqejaxf+vI7LtJ+ZWYdomw46jlpWWtYc+eZVJwRq59dEIQvjidKKWY9ZINjKhAAWUBxKbnh6yk eJEdR5Q2a5/SoB58TgIA==; 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 1dfNJj-0000nn-Ay; Wed, 09 Aug 2017 09:30:19 +0000 Received: from [218.249.47.110] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dfNIv-0007Mw-84; Wed, 09 Aug 2017 09:29:31 +0000 Received: from mtkcas32.mediatek.inc [(172.27.4.250)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 668401563; Wed, 09 Aug 2017 17:18:14 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 9 Aug 2017 17:18:13 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 9 Aug 2017 17:18:05 +0800 From: Chunfeng Yun To: Kishon Vijay Abraham I Subject: [PATCH 4/4] phy: tegra: use of_device_get_match_data() Date: Wed, 9 Aug 2017 17:18:00 +0800 Message-ID: <1502270280-13792-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1502270280-13792-1-git-send-email-chunfeng.yun@mediatek.com> References: <1502270280-13792-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170809_022929_615580_677DD7FF X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Viresh Kumar , Sekhar Nori , Kamil Debski , linux-tegra@vger.kernel.org, Thierry Reding , Vivek Gautam , Sylwester Nawrocki , Baoyou Xie , Lee Jones , linux-samsung-soc@vger.kernel.org, Axel Lin , Krzysztof Kozlowski , Jonathan Hunter , Jaehoon Chung , linux-rockchip@lists.infradead.org, Kukjin Kim , Chunfeng Yun , Arnd Bergmann , Bartlomiej Zolnierkiewicz , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP reduce the boilerplate code to get the specific data Signed-off-by: Chunfeng Yun --- drivers/phy/tegra/xusb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 3cbcb25..25cdfb1 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -848,7 +848,6 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev) struct device_node *np = of_node_get(pdev->dev.of_node); const struct tegra_xusb_padctl_soc *soc; struct tegra_xusb_padctl *padctl; - const struct of_device_id *match; struct resource *res; int err; @@ -861,8 +860,9 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev) of_node_put(np); - match = of_match_node(tegra_xusb_padctl_of_match, pdev->dev.of_node); - soc = match->data; + soc = of_device_get_match_data(&pdev->dev); + if (!soc) + return -EINVAL; padctl = soc->ops->probe(&pdev->dev, soc); if (IS_ERR(padctl))