From patchwork Mon Jul 16 14:41:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10526917 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 8D60D601D2 for ; Mon, 16 Jul 2018 14:42:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF685271FD for ; Mon, 16 Jul 2018 14:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2DB22848F; Mon, 16 Jul 2018 14:42:14 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59CAC271FD for ; Mon, 16 Jul 2018 14:42:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728947AbeGPPJ5 (ORCPT ); Mon, 16 Jul 2018 11:09:57 -0400 Received: from mail.bootlin.com ([62.4.15.54]:36440 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728290AbeGPPJ4 (ORCPT ); Mon, 16 Jul 2018 11:09:56 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 52A6420938; Mon, 16 Jul 2018 16:42:11 +0200 (CEST) Received: from localhost.localdomain (AAubervilliers-681-1-27-161.w90-88.abo.wanadoo.fr [90.88.147.161]) by mail.bootlin.com (Postfix) with ESMTPSA id DBADA2091A; Mon, 16 Jul 2018 16:42:10 +0200 (CEST) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Zhang Rui , Eduardo Valentin Cc: Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Antoine Tenart , Maxime Chevallier , Nadav Haklai , David Sniatkiwicz , Miquel Raynal Subject: [PATCH v3 10/23] thermal: armada: remove sensors validity from the IP initialization Date: Mon, 16 Jul 2018 16:41:53 +0200 Message-Id: <20180716144206.30985-11-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180716144206.30985-1-miquel.raynal@bootlin.com> References: <20180716144206.30985-1-miquel.raynal@bootlin.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 eef8947b9b20..7eafc9400fbe 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, @@ -650,6 +644,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)) {