Received: by 10.192.165.156 with SMTP id m28csp153553imm; Sun, 15 Apr 2018 19:36:32 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ix03x88QcfkAMY0Ugdz9Udhi+rtY7hq4Td8CJgmMaF1/3HweUJXYjr7IFBHv7hWMyX8qe X-Received: by 10.101.73.7 with SMTP id p7mr409549pgs.139.1523846191959; Sun, 15 Apr 2018 19:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523846191; cv=none; d=google.com; s=arc-20160816; b=cyFDoh36YgsgtgtZ4H37Odq0AK3++SbQRVWUr5ooRFuHH0VYKlkrz0pkjw8ynhyBND 8zEhq+Zpfv/fA0RS/5azSgw3YMxtmAL11co6iB9Lt1ZAbYfmlBqxP1bHLaz0JqY3Is3f 5BnW9+tOOErXa3vFbDi8HTYvGREmmUd9Wjp5e1PeQC4kjkwLHg1Y2sT5ycc1ZGsCs9Du z0WjSiYEYJ25DnXZwZbmgpUZKgCcMOaVXJ9Xn31bqIPR1Pre7AJ6Ango+oqQtVKjcUMY wRMTfXiUduDpiKoDj7QQ7G9gNdH8nll2ksnJujnlH2zrE7iRPQccxgwgsQuPlyZp/i5X GCzg== 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=TvRw1vhXLB//jGmFg8M/ljxj3cImplSDb1lYZ1Unlzw=; b=K2FWv7x0BNP2jDqOV1/EQyOqIaDrQlVr7f3njJfHZbx9rPrDgXwi6v4mWr9xD7rZl7 7FT1XVoHyjvdv8H7rG+W60nU8ShhLGx0BTkKjTV/TVwI3NKyk+yXYu1MSv2fcyA6tJqY iXQorjBnteC7S/W8l1qE2gDCkNqF0xwocV2NWf1QoKhQyWgYDWhDl0UMvh9cCnrntldx QPo4MLnmuwY3+9xtfoK++ooEA6Yb4oyEt7u0F/PvFWHA+Do9IjNd5G9YbnN8r2izbBwX MTA+436pNo8TzUZ91RdWWjNruRxsJI+EihQ6g/TvXXTF/Nk6D4dsPMDkHcPLBDgKqpnB 9zgw== 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 f90-v6si11049814plf.496.2018.04.15.19.36.18; Sun, 15 Apr 2018 19:36:31 -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 S1753224AbeDPCeX (ORCPT + 99 others); Sun, 15 Apr 2018 22:34:23 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:15797 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752783AbeDPCeW (ORCPT ); Sun, 15 Apr 2018 22:34:22 -0400 X-UUID: 06b2a1ac567d4754b20058ac18627864-20180416 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 15044091; Mon, 16 Apr 2018 10:34:18 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 16 Apr 2018 10:34:17 +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:34:16 +0800 From: Ryder Lee To: Zhang Rui CC: Dawei Chien , , , , , Ryder Lee Subject: [PATCH] thermal: mediatek: use of_device_get_match_data() Date: Mon, 16 Apr 2018 10:34:16 +0800 Message-ID: <475b09ee810255f6e98fb7a63e5afb1723b0328c.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_thermal_probe() is to match an entry in mtk_thermal_of_match[], so of_id cannot be NULL. Signed-off-by: Ryder Lee --- drivers/thermal/mtk_thermal.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index c75661a..12c3bc4 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -642,7 +642,6 @@ static int mtk_thermal_probe(struct platform_device *pdev) struct device_node *auxadc, *apmixedsys, *np = pdev->dev.of_node; struct mtk_thermal *mt; struct resource *res; - const struct of_device_id *of_id; u64 auxadc_phys_base, apmixed_phys_base; struct thermal_zone_device *tzdev; @@ -650,9 +649,7 @@ static int mtk_thermal_probe(struct platform_device *pdev) if (!mt) return -ENOMEM; - of_id = of_match_device(mtk_thermal_of_match, &pdev->dev); - if (of_id) - mt->conf = (const struct mtk_thermal_data *)of_id->data; + mt->conf = of_device_get_match_data(&pdev->dev); mt->clk_peri_therm = devm_clk_get(&pdev->dev, "therm"); if (IS_ERR(mt->clk_peri_therm)) -- 1.9.1