Received: by 10.192.165.156 with SMTP id m28csp153334imm; Sun, 15 Apr 2018 19:36:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48sJnA0yGF59k2sdHUx2uKPeUgPxTe7UA+SksE9/7olxaViLLY4NUUIk10S1BUm96MQFvfO X-Received: by 2002:a17:902:d90e:: with SMTP id c14-v6mr13775672plz.352.1523846169873; Sun, 15 Apr 2018 19:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523846169; cv=none; d=google.com; s=arc-20160816; b=NMY1bI1ae+XhVMdnWZd9BXsGImmduCY7o8JL1IpJJMzf0WdLQ4MlHa/g4OXvAd3GYA UiZwlJBnt6yhoPKW2XyeR4txU7s7lTebgZBYvGkZeLtVi2TUGu2aEzgEzTog0utSK4IL h5UoMKKH4eDVRhHB0xk6KNYKCs+KtHYSc1WGmZZRA6gqEa4h1un72IoddXLjr99wzOB8 1pH253tBF7bzDV21Q9n5NwBwhjWsEEL0mzvxhefeHl0h5VxmTk3dvtbVlelF3Lymwrd3 eFkPlXIpNgdAyNFCDLrDDAfBu3u/sps2muxez74yGVEtBn6moTHNp7yWPLdUhPgKUAWq T2jw== 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=ErYFWj61WX9u2LATMnwI07vbPYAuXEKs4vUAqXT+AIM=; b=nqP3rT5pCKGYuDT7Gc02Q0wry56LeRQfrl8Xu3HLIdCkUGuTeHNp5QtpiwK2bNC9jn CCERkTmwrps1n686xGMHNDqU2/mLYLtN9+SdHSD1n7kLr7yMcH/UEcc3/NZ8bHgQR2NS IFJluIW1Txg2fpBPtM3P7hiJgdM745jnJKpwRib/DKU8ZKLxy8F9EJOPIKlBtFUlsohM FUV/5kGzF8wa2dlftmlhm5yaMR0NSzINffSgPyaqYoBTdP0kQXkz2OgfPihCfeNIpfWb d1hnp9B9djmFE336vrgiiHyZNUvHuc8uoLIYBtkHzlrnAVh+MWlfkanmy10ervQWr2fp QSVg== 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 y11-v6si10874239plg.154.2018.04.15.19.35.56; Sun, 15 Apr 2018 19:36:09 -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 S1753169AbeDPCdu (ORCPT + 99 others); Sun, 15 Apr 2018 22:33:50 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:41359 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753139AbeDPCdt (ORCPT ); Sun, 15 Apr 2018 22:33:49 -0400 X-UUID: a1ccc2918fb74be6845bdddde40af7c1-20180416 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2076730525; Mon, 16 Apr 2018 10:33:44 +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:42 +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:42 +0800 From: Ryder Lee To: "David S. Miller" CC: Sean Wang , , , , , Ryder Lee Subject: [PATCH] net: mediatek: use of_device_get_match_data() Date: Mon, 16 Apr 2018 10:33:41 +0800 Message-ID: <9bf87205f84062580934168774d690d4cd2bf26b.1523347340.git.ryder.lee@mediatek.com> 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 mtk_probe() is to match an entry in of_mtk_match[], so match cannot be NULL. Signed-off-by: Ryder Lee --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index e0b72bf..d8ebf0a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2503,7 +2503,6 @@ static int mtk_probe(struct platform_device *pdev) { struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct device_node *mac_np; - const struct of_device_id *match; struct mtk_eth *eth; int err; int i; @@ -2512,8 +2511,7 @@ static int mtk_probe(struct platform_device *pdev) if (!eth) return -ENOMEM; - match = of_match_device(of_mtk_match, &pdev->dev); - eth->soc = (struct mtk_soc_data *)match->data; + eth->soc = of_device_get_match_data(&pdev->dev); eth->dev = &pdev->dev; eth->base = devm_ioremap_resource(&pdev->dev, res); -- 1.9.1