Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1855536pxb; Fri, 24 Sep 2021 13:37:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh9bbFhK2zxE+C3m1zFllcXcYEUjHVLOi+UfNYg3iJ2iOZZwc4RVIngANuYlbAEwtaZs8q X-Received: by 2002:a50:da04:: with SMTP id z4mr7150461edj.52.1632515844403; Fri, 24 Sep 2021 13:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632515844; cv=none; d=google.com; s=arc-20160816; b=E+b71YVna+m6oe/n+JyuqG84B4vWBPi2vn3z3z8B57qn2OuWb13UjCEHN6C3QIYVbC LWNeNTkIpbKh0Onkw9SgpU5a3tNsRm6mEDHOhUSiTRKoGMSRqNeTMUUG97NJfZc4zjir KxN0b+FRGpw/ArmUtS7BH/okBFYuUjROrKvGS4Jglrpf17rsCgMNthil4Zx6Lwr/RkMM 4osTxu+c0kjJtUsmzH6dti+xS8svyO657GG6Jm0MeLvgeyA8kLAVr5qgj4SNMNnzg2bQ KZO5fvWIlN1x8O+r/TPngdK+tLTD9bGdcc8oRo87C2SJ0PigtmXYxlMjRknEid5KcnYM q8uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CmVy62RQAO7C7hdQCFW/66O0AXnOBR9CKdDHcS6N+68=; b=vhE57W4d7S7My7U88cQ6hy1TFwb0mvlFxF+v2CaCDJ0WdccbJV58sYT2aEd4D5KJW/ 3r9sliXw6XMN/iuVQMBCBOIEErBpXfMgcF+KFO3ecH76Vka+YQbKAN5HGrsKlm28PJws 8zNSjxscbAOspjC4r/otb8Twu9k8vTk66RCFTmIeu9tiw+wK8M95w4xkO8yELfbQVkQ6 pRCeGeUi4grDcNLzAVScu1+D3vODpBP3PjNwF8MuHUJt0aHBlNmIfRqkpKL13zxV36ge ONMSSnZfwD10oVQcmDyqyFayPeX6ysPIdUGSckLggfDI8StHF1CSHTcBnZ9jaCzjLU3C b9qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R3lacFNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si10670667edz.206.2021.09.24.13.36.58; Fri, 24 Sep 2021 13:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R3lacFNg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346301AbhIXNPQ (ORCPT + 99 others); Fri, 24 Sep 2021 09:15:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:38882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346696AbhIXNKP (ORCPT ); Fri, 24 Sep 2021 09:10:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13B3061529; Fri, 24 Sep 2021 12:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632488290; bh=cHB/GLRWYlEG6alymObPpp6whcfSEBCn3AdLU1CnI5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3lacFNgyb85rtLDXkwyBbZrS5lfUvzVMon69/qn+ElH2cQHnGcR4CKF9OchY7f1O 39He9+cuU9zuT0I/eWyIeX9MibZeqOpT8o1V8IDQXEa9HYNXP2l4ztEcn9RCS/trle svy3n2Zq+klMWhSm0cJzl2QcqwIcXBelbKKcPzvU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Thierry Reding , Sasha Levin Subject: [PATCH 5.10 56/63] pwm: img: Dont modify HW state in .remove() callback Date: Fri, 24 Sep 2021 14:44:56 +0200 Message-Id: <20210924124336.193591111@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210924124334.228235870@linuxfoundation.org> References: <20210924124334.228235870@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König [ Upstream commit c68eb29c8e9067c08175dd0414f6984f236f719d ] A consumer is expected to disable a PWM before calling pwm_put(). And if they didn't there is hopefully a good reason (or the consumer needs fixing). Also if disabling an enabled PWM was the right thing to do, this should better be done in the framework instead of in each low level driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/pwm/pwm-img.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c index 22c002e685b3..37f9b688661d 100644 --- a/drivers/pwm/pwm-img.c +++ b/drivers/pwm/pwm-img.c @@ -329,23 +329,7 @@ err_pm_disable: static int img_pwm_remove(struct platform_device *pdev) { struct img_pwm_chip *pwm_chip = platform_get_drvdata(pdev); - u32 val; - unsigned int i; - int ret; - - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) { - pm_runtime_put(&pdev->dev); - return ret; - } - - for (i = 0; i < pwm_chip->chip.npwm; i++) { - val = img_pwm_readl(pwm_chip, PWM_CTRL_CFG); - val &= ~BIT(i); - img_pwm_writel(pwm_chip, PWM_CTRL_CFG, val); - } - pm_runtime_put(&pdev->dev); pm_runtime_disable(&pdev->dev); if (!pm_runtime_status_suspended(&pdev->dev)) img_pwm_runtime_suspend(&pdev->dev); -- 2.33.0