From patchwork Sat Aug 24 15:37:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 11113039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50C29912 for ; Sat, 24 Aug 2019 15:37:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A8872133F for ; Sat, 24 Aug 2019 15:37:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YoVaNpFI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A8872133F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kleine-koenig.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org 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=VtJ0HsKXq1UW4q92LQTDN8wQplDB/c/OQN+fqI8QSFI=; b=YoVaNpFIzbzF7X 1wio7ruljFM/Ur4ILpciDaLXWS0czQf/HYAH0EAGkZMSEE0hNcbTnGhT8wctMEXSrcBqa5PBM/oOn ehBuevg+kIyRlBx9jcpCWujIzqKLTwFaQ19nLiajaOfVc6gzuFl3nl6F2zH3n/3y3BbTq1PwBdGJ9 XuAJgnr+GaAHVHzQvlz3rT8YDm5tqOZtoVf0/X3w3QKjD/BhXki/AyV4Mxnu2KX8uqCYuvhmN4/Aw Psg3iCN8oqq3vXxmD3848KRvqaEp26M4fWYWapm8SNJVt6/OtQBiUNB2L5X64pORPPhACOS2q4AoE C7UH2HUjEejgWl9OMfcA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i1Y6q-0005Zc-Nn; Sat, 24 Aug 2019 15:37:44 +0000 Received: from antares.kleine-koenig.org ([94.130.110.236]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i1Y6n-0005Vs-Lx for linux-rockchip@lists.infradead.org; Sat, 24 Aug 2019 15:37:43 +0000 Received: by antares.kleine-koenig.org (Postfix, from userid 1000) id 7D21D77EAEC; Sat, 24 Aug 2019 17:37:40 +0200 (CEST) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , Heiko Stuebner , Maxime Ripard , Chen-Yu Tsai , Patrick Havelange Subject: [PATCH v3 5/6] pwm: fsl-ftm: Don't update the state for the caller of pwm_apply_state() Date: Sat, 24 Aug 2019 17:37:06 +0200 Message-Id: <20190824153707.13746-6-uwe@kleine-koenig.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190824153707.13746-1-uwe@kleine-koenig.org> References: <20190824153707.13746-1-uwe@kleine-koenig.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190824_083741_926204_6177FA0F X-CRM114-Status: UNSURE ( 7.82 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [94.130.110.236 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pwm@vger.kernel.org, kernel@pengutronix.de, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The pwm-fsl-ftm driver is one of only three PWM drivers which updates the state for the caller of pwm_apply_state(). This might have surprising results if the caller reuses the values expecting them to still represent the same state. Signed-off-by: Uwe Kleine-König --- drivers/pwm/pwm-fsl-ftm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/pwm/pwm-fsl-ftm.c b/drivers/pwm/pwm-fsl-ftm.c index 9d31a217111d..3c9738617ceb 100644 --- a/drivers/pwm/pwm-fsl-ftm.c +++ b/drivers/pwm/pwm-fsl-ftm.c @@ -292,10 +292,6 @@ static int fsl_pwm_apply_config(struct fsl_pwm_chip *fpc, regmap_update_bits(fpc->regmap, FTM_POL, BIT(pwm->hwpwm), reg_polarity); - newstate->period = fsl_pwm_ticks_to_ns(fpc, - fpc->period.mod_period + 1); - newstate->duty_cycle = fsl_pwm_ticks_to_ns(fpc, duty); - ftm_set_write_protection(fpc); return 0;