Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1748350pxb; Fri, 24 Sep 2021 10:56:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt9zWuRiFlJJYmPbVYbSHKD7gkfMUh4+cT4VT+NAmNy4LkI635hJT/W6CUvRRsTyeLqEgv X-Received: by 2002:a6b:c3ce:: with SMTP id t197mr10015139iof.159.1632506178483; Fri, 24 Sep 2021 10:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632506178; cv=none; d=google.com; s=arc-20160816; b=KYXxDXvCsOeBJClLYuoIIhX/NNiy/GrFmy5tj5BJoHXqL6Q4N4RLnFsO0aeiiOmdiW C3mHPeDCUMql3L8JkYfmP8YJxtkPG5fs37FKS4HKW5loHgCQLQ7mx0kI/VxIC01XOdYu qzM5yfykvq3WnZzTwZC4h8LV6QfzWi8IWXQXBr4i5mirTpM37BSMdOXc5YK3UhbynD6Q w+vC5CnKn1W4U1KYBpxBha1uc0qtTXeHECeIGIgFe/IqiomPpoP2vedJi2cyI1xMN2CD /px60pPr6Mo+CBH3DtOyy/847VY9pFT5q4/GPhibmOePkIRVv/+1jM/aAWtN3VI3SAym j9Aw== 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=YOMVlyTyrvbWl8jWJy63GkyzCzjvR6Pss14rbpliFSQ=; b=FI3Pba6jOuBAEZYltU+EdUb1/KtKw2MZE9zYxtcvEUDShVjncq1XermT1o7x9UAH2/ DPj0jjTaeA0uyPbOcxo2U4reOTCdjLnJ42h4XuLT1WIT0k1Iir0jW+fPjK5aKxhE57Eu Ra1ddGUS6jSxsWip3GTHBejNNQWS/ZZ2R8J1+CUywK5xzitiAq58zKM6ghQdq21Zc63l kh4Lsa8RnI7D+IFsGDY9ZK9d7OJdJBo9CADKNVRXw09pS8XNYBcvJu5DVQbDcZHaIWnY oOmqZuePj5YkciAnZ67fNv5VoqUNxVF8pBGjVWkBoHA7jrYyQRB46ikleGknzqVVF/LH 2xNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="bo/9YrlN"; 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 b7si12420392ilv.56.2021.09.24.10.56.04; Fri, 24 Sep 2021 10:56:18 -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="bo/9YrlN"; 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 S1345025AbhIXMyQ (ORCPT + 99 others); Fri, 24 Sep 2021 08:54:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:45884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344586AbhIXMwU (ORCPT ); Fri, 24 Sep 2021 08:52:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A81D610CF; Fri, 24 Sep 2021 12:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632487770; bh=lrw5VuysEtvhvv3KIILgqW21209M0KZA9cRbMYnP3Lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bo/9YrlNByAomp+GaQOdTfjdg7i7z9HmXA2xW1YovJVDUELteI+QzgpPBIzozRIoA qLXw8jOaV8U1KZAXl+LnlQqsZCtgDV+w/EXPR3Zvw/WpRRCpw1QIGgV3XT7yjwrdCe 6bLwdEr7EL7MrMorsiSmgJahc+f9y/Xxs7uwFzrw= 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 4.19 30/34] pwm: img: Dont modify HW state in .remove() callback Date: Fri, 24 Sep 2021 14:44:24 +0200 Message-Id: <20210924124330.952649700@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210924124329.965218583@linuxfoundation.org> References: <20210924124329.965218583@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 3b0a097ce2ab..6111e8848b07 100644 --- a/drivers/pwm/pwm-img.c +++ b/drivers/pwm/pwm-img.c @@ -332,23 +332,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