Received: by 10.192.165.156 with SMTP id m28csp153183imm; Sun, 15 Apr 2018 19:35:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Dnlx0B0ea/SBcARHF2WX/wJzwPaZLQd0uM1/BDkYkHtAvUxMPaWwyysAtt3yBinl8Gb6B X-Received: by 2002:a17:902:7c82:: with SMTP id y2-v6mr13882544pll.103.1523846150645; Sun, 15 Apr 2018 19:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523846150; cv=none; d=google.com; s=arc-20160816; b=dmaV8nnbCIoZHIost97hkF3uZlAwcHgrbFdW9L8jXTprctY6YRilG7xEHiK7bI/wvz bMf7Y3llVCUCPZIw2JNTAB+qwVuVNaUZLj7CVVNkOaK+crh6k0vlbKRDmwmAPCPXpjR/ XU23d6XaxEXEWc+X9YWm1mtRAolEXPOYF8zxy6GfCSFUHqOgziLh8G8RReO+vRUqHLKj QIz5HEbSaqQhuy3C5aEdiXCBka5SAu3EwlJ2KTPNRhw5E7xCIrdANVcK33+0B3eoZoU2 QegeNub70HFlDUvO1VvZzImTEeSbDS0RMFgI9AMSzZ8rDlEfaaoTsjrI5tnAJCuPiDON ftJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=WCQhYkOkig5s0JbBiJEg3mpbkdFRellNjz9M9AZYC8I=; b=erBtwhLbb3mFlnGbYuzuW5jKOhyJ0jWsF3FmCXOSpnG45O9cbBK8/50ixn+x5Ri7JQ ak28LTh06znNGYSMsSIsETEDcnkFBmoVAUS5T5vpcW9WwWHUJ/iH3GRh9SJZ2PiqKkwz StjG0qKKnq7B5RRmpSGMCc/8dLXdCUu+uatCWybH2fjdlciQMoF3TWDqtc8HMfEUeTx4 1ziH9DMwN7ncoDVjwGRx3EoEV3OzKmRbq2WddPGGF7zJCMxCxIv3OQyID1Ck4gVktMCe Bz11I/B/yrRSdh+WcIh6gOOXtgjfuxxkUP14J6K4LT7Rsyg7efWXCUdyDDxlK/KONIF7 6SdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si8625480pge.414.2018.04.15.19.35.36; Sun, 15 Apr 2018 19:35:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753199AbeDPCdy (ORCPT + 99 others); Sun, 15 Apr 2018 22:33:54 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:27612 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753139AbeDPCdv (ORCPT ); Sun, 15 Apr 2018 22:33:51 -0400 X-UUID: f083d57a62bc41968cbca0e1d2a16832-20180416 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 363062239; Mon, 16 Apr 2018 10:33:49 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 16 Apr 2018 10:33:48 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Mon, 16 Apr 2018 10:33:48 +0800 From: Ryder Lee To: Ulf Hansson CC: Chaotian Jing , , , , , Ryder Lee Subject: [PATCH] mmc: mediatek: use of_device_get_match_data() Date: Mon, 16 Apr 2018 10:33:47 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: <31f944ab8dfcc1d7b6f03b35657a2a34825b5246.1523347340.git.ryder.lee@mediatek.com> References: <31f944ab8dfcc1d7b6f03b35657a2a34825b5246.1523347340.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The usage of of_device_get_match_data() reduce the code size a bit. Also, the only way to call msdc_drv_probe() is to match an entry in msdc_of_ids[], so of_id cannot be NULL. Signed-off-by: Ryder Lee --- drivers/mmc/host/mtk-sd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 6457a7d..67e9b57 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1808,7 +1809,6 @@ static int msdc_drv_probe(struct platform_device *pdev) struct mmc_host *mmc; struct msdc_host *host; struct resource *res; - const struct of_device_id *of_id; int ret; if (!pdev->dev.of_node) { @@ -1816,9 +1816,6 @@ static int msdc_drv_probe(struct platform_device *pdev) return -EINVAL; } - of_id = of_match_node(msdc_of_ids, pdev->dev.of_node); - if (!of_id) - return -EINVAL; /* Allocate MMC host for this device */ mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev); if (!mmc) @@ -1887,7 +1884,7 @@ static int msdc_drv_probe(struct platform_device *pdev) msdc_of_property_parse(pdev, host); host->dev = &pdev->dev; - host->dev_comp = of_id->data; + host->dev_comp = of_device_get_match_data(&pdev->dev); host->mmc = mmc; host->src_clk_freq = clk_get_rate(host->src_clk); /* Set host parameters to mmc */ -- 1.9.1