From patchwork Mon Jun 25 15:12:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10486669 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 082F66023A for ; Mon, 25 Jun 2018 15:18:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 011892785D for ; Mon, 25 Jun 2018 15:18:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E988027EED; Mon, 25 Jun 2018 15:18:35 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 946E82785D for ; Mon, 25 Jun 2018 15:18:35 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=/ROrU8bFQbzpjZ7D0s6X+4zpuZCSeLeQoFjWZv4WxL8=; b=tBOtI8+b4f6OgoekuGM2MaBCp0 WRidaWO++iU+SCIZm/Vy6LzaMVlmAVoseOL0bZx+WVOSAerPgunwOzYCl1q+LMN/cmzenT3IuUq0I Bx/3LbNeX/XOSKGsrUQOd62ZeB/FmLnbfDoYTapROxQWZh/O3r43rY7+eJ2h+CG94IJPothRGZzQv 9+Oyo8N4x4KlyqAYsUYGt9D8f6jRso9UoygC8ThfjwOrsIOqgL/K6pidxSuS00ZCiExXdkFJ4S8mU 3SaHJOUtO4AywQBI8b7r6TJ74pd7qz7qVAp3OK2KuPvRcBREU/iKukqbsAUumvwvfUGpIPfd9Y1Dh 8W33kg3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTG3-0003aO-OT; Mon, 25 Jun 2018 15:18:23 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTB6-0007xS-Ur for linux-arm-kernel@bombadil.infradead.org; Mon, 25 Jun 2018 15:13:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q/+6A554m1aNfdFtug0wncwjLfOiX2lUTRXCExkyfPE=; b=kupCtYnYZ7VAFy/KjlaG3eK2V wH6owaGSfDVVT9KVbysxQYuJBiX6HEJn6RkNpIqILj7DgmhaFiZvpMqAHEuWM0K/RrnGYm49PDJO/ 7ghhcCW2Ta8/LwlRuzuTEbuN8n57e7AODVXG2l4MGg3a79vcng+ZjLFzM1if7zn40rQHlWhrkqafj YB8IB0UyyBoS+fQEW0OC0A/UXz6yMJX8JQsXbofrbUHYeeJ1Oj2n/W6v7XFhWpHdWA/FiOIv8oBsQ Ma3gFwwHZ99nj6xZVjYM16GybV2XZaRG7rQHIMtGlaZ1jWi7+m3Rw/v+L8HM8HD6+fLCh01QG9f8E g8fwiJLyA==; Received: from mail.bootlin.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXTAw-0003df-Bu for linux-arm-kernel@lists.infradead.org; Mon, 25 Jun 2018 15:13:12 +0000 Received: by mail.bootlin.com (Postfix, from userid 110) id BDACF20CFE; Mon, 25 Jun 2018 17:12:44 +0200 (CEST) Received: from localhost.localdomain (AAubervilliers-681-1-87-188.w90-88.abo.wanadoo.fr [90.88.29.188]) by mail.bootlin.com (Postfix) with ESMTPSA id 527FF203B4; Mon, 25 Jun 2018 17:12:44 +0200 (CEST) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Zhang Rui , Eduardo Valentin Subject: [PATCH v2 09/23] thermal: armada: remove sensors validity from the IP initialization Date: Mon, 25 Jun 2018 17:12:25 +0200 Message-Id: <20180625151239.20976-10-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180625151239.20976-1-miquel.raynal@bootlin.com> References: <20180625151239.20976-1-miquel.raynal@bootlin.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180625_111306_789741_49FA7033 X-CRM114-Status: GOOD ( 12.51 ) X-BeenThere: linux-arm-kernel@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 , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Antoine Tenart , Catalin Marinas , Will Deacon , Maxime Chevallier , Nadav Haklai , David Sniatkiwicz , Rob Herring , Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When using new bindings with multiple sensors, sensor validity is checked twice because sensor selection also checks for the validity. Remove the redundant call from the IP initialization helper and move it to the legacy probe section where it is still needed. Signed-off-by: Miquel Raynal --- drivers/thermal/armada_thermal.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index 2b11bf929b64..3d5b29133d3a 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -221,9 +221,6 @@ static void armada380_init(struct platform_device *pdev, reg &= ~CONTROL0_TSEN_TC_TRIM_MASK; reg |= CONTROL0_TSEN_TC_TRIM_VAL; regmap_write(priv->syscon, data->syscon_control0_off, reg); - - /* Wait the sensors to be valid or the core will warn the user */ - armada_wait_sensor_validity(priv); } static void armada_ap806_init(struct platform_device *pdev, @@ -243,9 +240,6 @@ static void armada_ap806_init(struct platform_device *pdev, reg &= ~CONTROL0_TSEN_AVG_BYPASS; regmap_write(priv->syscon, data->syscon_control0_off, reg); - - /* Wait the sensors to be valid or the core will warn the user */ - armada_wait_sensor_validity(priv); } static void armada_cp110_init(struct platform_device *pdev, @@ -657,6 +651,9 @@ static int armada_thermal_probe(struct platform_device *pdev) priv->data->init(pdev, priv); + /* Wait the sensors to be valid */ + armada_wait_sensor_validity(priv); + tz = thermal_zone_device_register(priv->zone_name, 0, 0, priv, &legacy_ops, NULL, 0, 0); if (IS_ERR(tz)) {