From patchwork Thu Jul 27 05:46:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Yu X-Patchwork-Id: 9866317 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 29E606038C for ; Thu, 27 Jul 2017 05:48:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C37628665 for ; Thu, 27 Jul 2017 05:48:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0FAE3287D3; Thu, 27 Jul 2017 05:48:41 +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 C72AC28665 for ; Thu, 27 Jul 2017 05:48:40 +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=3It142qO8iJZ4jBKSq7YY0m6hV6r5sV+DOG74Ow6VsU=; b=eeBUSwPK5CMKDD 7192Vt+WvjUCh/Cy12MglJUXAsOQ/+jeasw2F1uqDdJCN3kpvHwYTfP4U6L7YodIlVwKSGGc0/XqU 7MvKWOuMgFPgI1kTmotKlNWo4z9cDo55ST3lF3IjXN5AcDZjSuuvlLdqJsmGx7w+SyI/H0t9YKOto sX6P05TS2eQCEBHge8iF/kCdHSp6hnuX5JGopKPnxf290vDVUBpSf6dH5l+1LCO1kXI1lbjyxMfXO It8ZtN/Kwh5WLqR57yhA50lKqjYbDeV2lP3+NTtZpqHZr0V2gJc+j58wzNU13jaBKmqEbIczAm5Y3 e/pvnfFFmxRhlDrQ/Atw==; 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 1dabf5-0005Da-Rc; Thu, 27 Jul 2017 05:48:39 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dabf2-000516-EN for linux-mediatek@lists.infradead.org; Thu, 27 Jul 2017 05:48:38 +0000 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 378319316; Thu, 27 Jul 2017 13:48:15 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 27 Jul 2017 13:48:12 +0800 Received: from localhost.localdomain (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 27 Jul 2017 13:47:58 +0800 From: To: Zhang Rui , Eduardo Valentin Subject: [PATCH v1 4/4] thermal: mediatek: minor mtk_thermal.c cleanups Date: Thu, 27 Jul 2017 13:46:57 +0800 Message-ID: <1501134417-3505-5-git-send-email-louis.yu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1501134417-3505-1-git-send-email-louis.yu@mediatek.com> References: <1501134417-3505-1-git-send-email-louis.yu@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-20170726_224836_639481_893534EF X-CRM114-Status: GOOD ( 12.55 ) 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: Mark Rutland , srv_heupstream@mediatek.com, linux-pm@vger.kernel.org, Louis Yu , dawei.chien@mediatek.com, fan.chen@mediatek.com, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , eddie.huang@mediatek.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Louis Yu Move thermal module reset in the beginning and revise clock error handle flow to pair the clock control. Signed-off-by: Louis Yu --- drivers/thermal/mtk_thermal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index f2a7155..5dffdb4 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -712,20 +712,20 @@ static int mtk_thermal_probe(struct platform_device *pdev) return -EINVAL; } + ret = device_reset(&pdev->dev); + if (ret) + return ret; + ret = clk_prepare_enable(mt->clk_auxadc); if (ret) { dev_err(&pdev->dev, "Can't enable auxadc clk: %d\n", ret); - return ret; - } - - ret = device_reset(&pdev->dev); - if (ret) goto err_disable_clk_auxadc; + } ret = clk_prepare_enable(mt->clk_peri_therm); if (ret) { dev_err(&pdev->dev, "Can't enable peri clk: %d\n", ret); - goto err_disable_clk_auxadc; + goto err_disable_clk_peri_therm; } for (i = 0; i < mt->conf->num_banks; i++)