From patchwork Tue Mar 12 21:46:03 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: 10851001 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49FDC13B5 for ; Wed, 13 Mar 2019 11:33:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B6A29B72 for ; Wed, 13 Mar 2019 11:33:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C05329B75; Wed, 13 Mar 2019 11:33:39 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 DA9B729B72 for ; Wed, 13 Mar 2019 11:33:38 +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=15PxwrOxvOVeY4wg8mNEMPB+WRWuStIAhApVb2+01U0=; b=VP5M7zQZMOwWut qFFbICy4SjJk3D32HqdGB39OiF1SUs48sXe+CqqltFb0I/jiT0PYFAzkb6bvxRMNe4O2REtwkXus5 gSqUDrv3PPXLRFkHjBGsdc7bGEW6PpxXCvrzLAFLqzpsYDtVUjYZdATVvmElgrjCIrlQVdoACZeqN PzSkS8Smtiuo+wAIAunDmOoF88js2lPjNW5pMtyNRePqdV9tThbtttgMuxUU0dQt4du2N4PSVpZFK dQqOcS8oTnUmpeIsbiye+BMpydgsoEj+2E7nIT54Eogy6KFUPpcggx6Iwvn1BqAXUi3uEx/WUimC0 VaqhtUGwI20bmPek60gw==; 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 1h428e-0003Ks-1y; Wed, 13 Mar 2019 11:33:36 +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 1h426j-0008SO-M8 for linux-rockchip@bombadil.infradead.org; Wed, 13 Mar 2019 11:31:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To: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=abZ/g8nUts+EfMcyXYFA6zniZRxjEonK1WaydzoV3AQ=; b=uh/3P0sTLRdIluRg4ssPY6Q8ij b0KcRZhwINv0INYFoZWfZSZCAqohTenw9LGeuSihXHYd8eaVYvIGMUrlB8BOd70te1+y7dM+ePkpA egOlne4Bv8C54zs/KwZ51smUgtKAIWAsLRSS5iF2t7C3a5Bdtu30gcrKaE55/j/bo706s5S3hUP+Z BWFA1405mnyHOVf5+byPn9paBE+7QrPxdIfKkpJK0lsIwmXIeuAWWFqMY7pn743+hYU4G9wiu/0kL x7NsTL/AlUJNZENSDtwUMgsmLed96PBp8THAZ6vYoH1riGCsKTYgd9n7yhf46wocP/z6ergzb8JU2 H6gW8EaQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3pFi-0006iE-Ap for linux-rockchip@lists.infradead.org; Tue, 12 Mar 2019 21:48:03 +0000 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h3pDv-0007AS-3n; Tue, 12 Mar 2019 22:46:11 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1h3pDr-0005iI-Cs; Tue, 12 Mar 2019 22:46:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , Heiko Stuebner , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v2 1/3] pwm: rockchip: Don't update the state for the caller of pwm_apply_state() Date: Tue, 12 Mar 2019 22:46:03 +0100 Message-Id: <20190312214605.10223-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190312214605.10223-1-u.kleine-koenig@pengutronix.de> References: <20190312214605.10223-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190312_174802_546355_07C57E8C X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 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 X-Virus-Scanned: ClamAV using ClamSMTP The pwm-rockchip driver is one of only two 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. Also note that this feedback was incomplete as the matching struct pwm_device::state wasn't updated and so pwm_get_state still returned the originally requested state. Signed-off-by: Uwe Kleine-König Tested-by: Heiko Stuebner --- drivers/pwm/pwm-rockchip.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index 4d99d468df09..16186bcd99e0 100644 --- a/drivers/pwm/pwm-rockchip.c +++ b/drivers/pwm/pwm-rockchip.c @@ -215,12 +215,6 @@ static int rockchip_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, goto out; } - /* - * Update the state with the real hardware, which can differ a bit - * because of period/duty_cycle approximation. - */ - rockchip_pwm_get_state(chip, pwm, state); - out: clk_disable(pc->pclk);