Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp485583pxj; Thu, 20 May 2021 14:08:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMDjiIViSNTg6Ve5iheWpXAzZMrHhRTYC34jLJbnchKaHxTDUQjYOzV/59r90lHZzK+fq4 X-Received: by 2002:a6b:e91a:: with SMTP id u26mr7172928iof.83.1621544937069; Thu, 20 May 2021 14:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621544937; cv=none; d=google.com; s=arc-20160816; b=POfZ40M+8hxW2PJ8X8GaFMENVFFwJB+BIb5yGQRJqOVB6GJFizf/+PVNaL2X/vbdKG IrQ6BogYKBNVmSR4K6q7zUqQQBnhLjqmJFqgdef5qABZ0o2Z/sghSbR6HAT1Bss/a89g 992CRATEY+qwYYGqk913DtMENNcNDcDVoag+h9dAg1LsjfYOBNld9vhm4wh4wDn2z3ie WsoUNv1byZV0+fHg54COZyT5EQ/Dzfw5yMb28/27J7oLlNsfOH6L20Pwso4q0PyfRknW aYA25XrztmEq1vq3sPiVoBuh+bmyU72T4egw6HCRtk2pAYOKFmxAQMHsHl4ME8YiikaQ CRDw== 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=uWSdg5f/aYxRD3lmH+UInOaILOAU0lEe4SugyScib3c=; b=JetqT383D3oKn5HBEA8EbaBvgaN5FlWagiPIbvOw2E3hju5RHlZwd0yQJhBS4bgT0r TwLnqud3nggNtKpQpuPwjVcS+J9I+3gjv04EFU6oqp/DBQwVqDr6iyoTihI4uuogGgqE SvpkQ5MdYRoXJ4cEU8qqqLdRTfZsl1bwqIv4JeNqEGacTgwS2ckrHvYH0N6pI70jSx12 2c0r54QSJKBPx3qPQ8viMo+hQhJ7WB5cQ2gPAabGO1GWd/inr5iyWoY+Ox3UDB46OggV 9aUwHlkeJPoBMGSwY2DJY4W0W6k+7ORQd88HAQAN+7c7nPbOkrNqWyl5tqgoN3KT9gvk 5wBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s0bFRxN8; 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 j20si3450735ilo.56.2021.05.20.14.08.32; Thu, 20 May 2021 14:08:57 -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=s0bFRxN8; 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 S238271AbhETLAh (ORCPT + 99 others); Thu, 20 May 2021 07:00:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:43968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237155AbhETKmv (ORCPT ); Thu, 20 May 2021 06:42:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5DABD60FDC; Thu, 20 May 2021 09:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504593; bh=GxlB8B0EGVObBMu3dqn2DEXKVHBEkFmPY9lNi0SB8ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0bFRxN8Y9oBJtLNhDmc6JX8gFAu9yf7P+Ungi7vZ9S4Zg5AhWqAajmmNRmB/6P4j UuvHpbp3PaDa5gtk0jT/vHaj+ksryQ5U0wNJMvv4wcDjeV//55X64xYNY+qH+oCwHP FKqIkY55vJWZMH35P2VI3M0Lo6azUE38vlfYSBs4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Andy Shevchenko , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.14 282/323] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Date: Thu, 20 May 2021 11:22:54 +0200 Message-Id: <20210520092129.879447035@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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: Dinghao Liu [ Upstream commit a2fa9242e89f27696515699fe0f0296bf1ac1815 ] When lidar_write_control() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. Fixes: 4ac4e086fd8c5 ("iio: pulsedlight-lidar-lite: add runtime PM") Signed-off-by: Dinghao Liu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210412053204.4889-1-dinghao.liu@zju.edu.cn Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index 36c1ddc251aa..c033db701bb5 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -166,6 +166,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); if (ret < 0) { dev_err(&client->dev, "cannot send start measurement command"); + pm_runtime_put_noidle(&client->dev); return ret; } -- 2.30.2