Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp34380pxj; Mon, 17 May 2021 20:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywiFBDviApNe9ekPN9hyQFTkC491HCDwb3Tri9JxYm8tiLX5HkHL3mTuKBgeq/U/wVepEA X-Received: by 2002:a05:6638:344e:: with SMTP id q14mr3248361jav.47.1621307470727; Mon, 17 May 2021 20:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621307470; cv=none; d=google.com; s=arc-20160816; b=LktZ2bONoWTOEtRBkyduPT2lgWVtwFW6RWlu1pExNPcn251cPDqljKIf58OjEf1MKk SQrABEzFK5mgBtiyNLL44YTd//p6QVtqinDZe55bemb8gws7eE1U4+1LPbSNkmhV3/Y5 ujMBqLujt3RYE1hPYbKVll26Lq9MzDbfVAJyjFKXIvCf4ZElBXAbGia3vDQr4Uv3ulc4 qGeI97pETYa2jkXKIM8OwYVT+1TZ364FfDjOL3gXq1BF2NoSZ+0MSP3jGD5gIBUYaIrK cPbk8a4wnysXiKMkcpVWYm5bY4VvZOB3WEBQhZxeLTQ6VOG4Ucc6fsshf5v+7FNnU86c vlrg== 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=9jlbJyH3jfq3259nNWubCDO4UrLguynrT3LjQhSuTqs=; b=e9g9TfvP7hhfdS11KL/U6u8aMr0Z/U6NItXvJVWO7QrQO0HZnaAqyl5ip/VEHu2cJz wtbxLwv/D01OAs8UarEwTYOX1KMMVZRDxdsHPO/L5/r7/As1+eCd4ZSBvd/otECvJjHq UMLcktRL5Z+8AxfyhPAxL5WU+YUASgqe/tBHeUh8y0SFg3a5sPKcRWfDFpOcMNQno6Vw E6T3/emwNnbcYIP4ENJVCY2m0aShggqUMScXyF3gLRk44Vg00KoKTKJILpIW7sN4sUFL ichQm/IdWF4QKpsxnYWxbUOjVq7L/0E57DY4hUCYOyVnt+Y8GOeXLVENh7iA0QVXZKDT XFvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DxGJXyj3; 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 o16si19661413ioo.17.2021.05.17.20.10.57; Mon, 17 May 2021 20:11:10 -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=DxGJXyj3; 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 S241063AbhEQOjX (ORCPT + 99 others); Mon, 17 May 2021 10:39:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:58374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240364AbhEQOeJ (ORCPT ); Mon, 17 May 2021 10:34:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 565C161184; Mon, 17 May 2021 14:16:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260998; bh=sm8ZH7gysXzcnQnc1SaFFmXLhMTtkYqQ/OCrUYQWeio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DxGJXyj3v0BL4F7j/7Q6zwt1Vy+M6p2MT/EQg6m7x7Vrs9eC7fFSDCCxLINohMnr6 6rLUdZ92LUGaAXGOmxr4M2w7x2nt9GRgUwhzBncIJ0yuW7Xet6n5KTCqEZlgTpVI/S CexzXBRcTeSPAvMwKyoDtO0xXxijF9LP6EoTjZkU= 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 5.12 287/363] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Date: Mon, 17 May 2021 16:02:33 +0200 Message-Id: <20210517140312.309697223@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 c685f10b5ae4..cc206bfa09c7 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -160,6 +160,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