From patchwork Tue Sep 5 08:06:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9938181 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 0CFDB601EB for ; Tue, 5 Sep 2017 08:18:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0F59288E8 for ; Tue, 5 Sep 2017 08:18:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E49A028907; Tue, 5 Sep 2017 08:18:25 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D528288E8 for ; Tue, 5 Sep 2017 08:18:25 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id E3A0841C; Tue, 5 Sep 2017 08:17:30 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 220F3A67 for ; Tue, 5 Sep 2017 08:17:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 761B21F2 for ; Tue, 5 Sep 2017 08:17:28 +0000 (UTC) Received: from penelope.horms.nl (88.red-79-157-204.dynamicip.rima-tde.net [79.157.204.88]) by kirsty.vergenet.net (Postfix) with ESMTPA id A1DBD25BE7D; Tue, 5 Sep 2017 18:07:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1504598847; bh=7N19YuD9/n2kR8sXuMULzcLIYsVhN5FiNN0jP9FgyB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ieOdAXaEj4mvNFels/NqU2s1YRgyCNJZTR0S2A8OuEGyJe+cRH1Py/7xMFu4SnT2a wmSwtvpfYufVnPcMnWVdoDl6C9BmI6VWUtqjMk1bRZU1eAXlTEaLRTv2U4LE91twtw SfUEOz7QM4bHmOVo1bZy1YIm/hCH1+KkyZJOhlRY= Received: by penelope.horms.nl (Postfix, from userid 7100) id DA898E23442; Tue, 5 Sep 2017 04:06:59 -0400 (EDT) From: Simon Horman To: Greg KH Date: Tue, 5 Sep 2017 10:06:39 +0200 Message-Id: <1504598808-19810-5-git-send-email-horms@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> MIME-Version: 1.0 Cc: ltsi-dev@lists.linuxfoundation.org, linux-renesas-soc@vger.kernel.org, Magnus Damm Subject: [LTSI-dev] [PATCH 04/13] thermal: rcar_gen3_thermal: remove unneeded mutex X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Niklas Söderlund There is no point in protecting a register read with a lock. This is most likely a leftover from when the driver was reworked before being submitted for upstream. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Eduardo Valentin (cherry picked from commit 100cfbcf2580b0605f50af32fefd9c8d1d8357fb) Signed-off-by: Simon Horman --- drivers/thermal/rcar_gen3_thermal.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index ec477d47d0ba..cb5c362c0000 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -72,7 +71,6 @@ struct rcar_gen3_thermal_tsc { void __iomem *base; struct thermal_zone_device *zone; struct equation_coefs coef; - struct mutex lock; }; struct rcar_gen3_thermal_priv { @@ -163,16 +161,12 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) u32 reg; /* Read register and convert to mili Celsius */ - mutex_lock(&tsc->lock); - reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1); val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2); mcelsius = FIXPT_TO_MCELSIUS((val1 + val2) / 2); - mutex_unlock(&tsc->lock); - /* Make sure we are inside specifications */ if ((mcelsius < MCELSIUS(-40)) || (mcelsius > MCELSIUS(125))) return -EIO; @@ -299,7 +293,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) } priv->tscs[i] = tsc; - mutex_init(&tsc->lock); match_data->thermal_init(tsc); rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);