From patchwork Tue Mar 12 08:35:35 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: 10848737 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 6B3FE14DE for ; Tue, 12 Mar 2019 08:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5791728CE8 for ; Tue, 12 Mar 2019 08:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B3A72957A; Tue, 12 Mar 2019 08:35:48 +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 F3B5928CE8 for ; Tue, 12 Mar 2019 08:35:47 +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: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:In-Reply-To:References: List-Owner; bh=T7uZJLRWquI+I2+d0/e1kVy3qXGEzAwu58xY8pu61S4=; b=syexmDrLwclKFA swFZmOavRtdSIfaRrx3FHzqIWS3E8xtZN5R1r5zqV8RMlwCv0Q5B54j6VfBl6FYlVbX7juKOQG+yA eYbVbheM4NzvRo+7xDb97KfTk9S5tygqikSVBc+dxx0QiLNpbEnl8G/9zDRQDcmmgl6QD1z6cTnZP fEVB6qdDjUU3eMdEfVsC91rmiKfy/rTlemhKFykcvCH+mARLtCLF7fb/tADPH/zamuQz9xeAsisAJ r06ona+Ad08WjgD3Z30VfKPYJa1Rv/NfpzqxnLFlNmwdTRtzEXY3nh9RYBYx8499HM0rkZCZsitmi Fzvuedu5h0uM2YVc5wbw==; 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 1h3csz-0005Cc-J4; Tue, 12 Mar 2019 08:35:45 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h3csw-0005BO-U7 for linux-rockchip@lists.infradead.org; Tue, 12 Mar 2019 08:35:44 +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 1h3csu-0005wS-9J; Tue, 12 Mar 2019 09:35:40 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1h3cst-0005fY-L6; Tue, 12 Mar 2019 09:35:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding , Heiko Stuebner Subject: [PATCH 0/2] pwm: ensure pwm_apply_state() doesn't modify the state argument Date: Tue, 12 Mar 2019 09:35:35 +0100 Message-Id: <20190312083537.23748-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.20.1 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_013543_198876_58754612 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. 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 Hello, this series is a followup to my mail claiming that changing the state argument for a caller of pwm_apply_state() is a bad idea. See the commit log for the second patch for the reasoning. The only driver that actually modified the argument is the rockchip driver which howver didn't ensure that struct pwm_device::state is updated accordingly which made pwm_get_state() return the old state. The first patch addresses this by dropping the modification. Best regards Uwe Uwe Kleine-König (2): pwm: rockchip: Don't update the state for the caller of pwm_apply_state() pwm: ensure pwm_apply_state() doesn't modify the state argument drivers/pwm/core.c | 2 +- drivers/pwm/pwm-atmel-hlcdc.c | 2 +- drivers/pwm/pwm-atmel.c | 2 +- drivers/pwm/pwm-bcm-iproc.c | 2 +- drivers/pwm/pwm-cros-ec.c | 2 +- drivers/pwm/pwm-hibvt.c | 2 +- drivers/pwm/pwm-imx27.c | 2 +- drivers/pwm/pwm-lpss.c | 2 +- drivers/pwm/pwm-meson.c | 2 +- drivers/pwm/pwm-rcar.c | 2 +- drivers/pwm/pwm-rockchip.c | 10 ++-------- drivers/pwm/pwm-stm32-lp.c | 2 +- drivers/pwm/pwm-sun4i.c | 10 ++-------- drivers/pwm/pwm-zx.c | 2 +- include/linux/pwm.h | 4 ++-- 15 files changed, 18 insertions(+), 30 deletions(-)