From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8CA9C43381 for ; Fri, 22 Mar 2019 12:49:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E2FC218E2 for ; Fri, 22 Mar 2019 12:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553258940; bh=BNnE4xAeJ25K+aBQ93rtyT7ZRGZFJvtMPgt6mGwtGuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wDSKeukfBdXzD4QKNXjn9rFYwIxVtyMbeujxUkp8d7yObXaS1CQf4ecg9U6s+Chu/ 20Vq2vb/I8USQBcgscPq7NPRzwKnX1JaVvrHPwX5sYJiBO8aN5fiCET7CHh8n8/Iex bF81s5h64dha0DmPlcJMWC0Yjfl640ygCeLuSMd8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733012AbfCVMs7 (ORCPT ); Fri, 22 Mar 2019 08:48:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:33972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387659AbfCVL53 (ORCPT ); Fri, 22 Mar 2019 07:57:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 226632192B; Fri, 22 Mar 2019 11:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255848; bh=BNnE4xAeJ25K+aBQ93rtyT7ZRGZFJvtMPgt6mGwtGuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uR6PHrMa4POFL0PdpMClDxoFlagVXOWWdJQ476lWpP2K3uWhAngIoS2ivgduFWd8s uWY8HJT+7HcqEGs5OSUTLSpT0pTZc+GUAmZbnz+fA+3QRCTvo2TuUhkbM7wrF4iAxm BIJ82tcvx4pHHuntPVDB78rXYrHhKkWB/AcEC3Rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pawe=C5=82=20Chmiel?= , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.19 033/280] Input: pwm-vibra - stop regulator after disabling pwm, not before Date: Fri, 22 Mar 2019 12:13:06 +0100 Message-Id: <20190322111308.173157472@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111306.356185024@linuxfoundation.org> References: <20190322111306.356185024@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 94803aef3533676194c772383472636c453e3147 ] This patch fixes order of disable calls in pwm_vibrator_stop. Currently when starting device, we first enable vcc regulator and then setup and enable pwm. When stopping, we should do this in oposite order, so first disable pwm and then disable regulator. Previously order was the same as in start. Signed-off-by: Paweł Chmiel Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/misc/pwm-vibra.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c index 9df87431d7d4..dbb6d9e1b947 100644 --- a/drivers/input/misc/pwm-vibra.c +++ b/drivers/input/misc/pwm-vibra.c @@ -80,14 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator) static void pwm_vibrator_stop(struct pwm_vibrator *vibrator) { + if (vibrator->pwm_dir) + pwm_disable(vibrator->pwm_dir); + pwm_disable(vibrator->pwm); + if (vibrator->vcc_on) { regulator_disable(vibrator->vcc); vibrator->vcc_on = false; } - - if (vibrator->pwm_dir) - pwm_disable(vibrator->pwm_dir); - pwm_disable(vibrator->pwm); } static void pwm_vibrator_play_work(struct work_struct *work) -- 2.19.1