Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp621564pxy; Wed, 28 Apr 2021 10:38:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1eJ7YQ3MYWhFfuwhXzinTamDLuobOtCR1zqsFqcefkXZZjIZ3FMHmGjWi6lEc3P1y8UM2 X-Received: by 2002:a17:906:82cb:: with SMTP id a11mr17987960ejy.213.1619631402202; Wed, 28 Apr 2021 10:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631402; cv=none; d=google.com; s=arc-20160816; b=P091WloZNj1H+dDNubosF2OFpgiQVV0dJgs15Ue+/v+c//OaPA4tM6QQjPPnrpW9Pt MVqx7dTrIej8soOnQxB/YiElta1KeGNNqlkKszWpNzOXGKs77MAbHX4j2jcIAsGmNe8P fgPhsTc8ut4gKAnmm+O93hT5gkhvQLzMgbiwvJS+3UwRRdy/9QLdW1UCLpiOFdFSIzdj KUVfBbq+kvjkUrUrt/WfjLu/wUKp8vmIOcjj+T3CiLzvqOZUxn5AY0LVhOmWxz5oPvkT 4KGHaUNT5rskw+AvnuH1wg3ho6GItx4rwrPNH6Gu7CJ+YhgLWpx3HU1h9LnF2np3/iaS +VMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=YY+9ySulXr3xOJiKlXEpT3t6C05wB27OdcqmX73YmsU=; b=0BcG6OocQ9prlkjtB8jePX0sNO+N3ypVoBH2ruh+/pvmoTRzLQvI0jZTygOKFjcoYC PjW1oe4wRdqNbDj2HtWgllj9dAcEHfOeswTBp7POg2U3q+EuVNR5PEc+TRJuIIkexWde vXI9jlV7kYEcUl/mN14Sl7N4WAj7pdFdLG37B44g7A50mPk8fVKQXGI58xTbSbrF9Dsg CH0BRUUI0Urk6XLy2BkiU6YN/TucjxGKtP4VSRMmuK7CePDc96oWzcn+8gVtDsPa32Do nsz/0Rpjgu0le7ZtG/BSLRqBe176xU0rLzl+rHqDhI+srarsNXk1GcoGy/7H3oREEZRa Wi8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=pSWtkaIq; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds10si758579ejc.415.2021.04.28.10.36.18; Wed, 28 Apr 2021 10:36:42 -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=fail header.i=@kernel.org header.s=k20201202 header.b=pSWtkaIq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240120AbhD1PAT (ORCPT + 99 others); Wed, 28 Apr 2021 11:00:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:36802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240356AbhD1Oxo (ORCPT ); Wed, 28 Apr 2021 10:53:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8AC4061928; Wed, 28 Apr 2021 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619621564; bh=RKkiGoCDSW3lMHxV9n7JS+4PruB0khbogVRD1m+DqBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pSWtkaIqJ30NOq+rbHn2rQQa9uXOTFSDe0mptSY05h0lajdh5p2PajviD3hyq+mdD wwMJ4Nb23fr3RaOk0jiMqnO6pKgv+/nrODKM2eax7JXp0SutxTDS12LROSNgoQ/0wx s9vpwlx4pSrS5RezheFn2UqCwMBiV0aZ3yTiRBsx3CuUb94ogUQOCLtfOyCmzy4g+5 5Jx06oGlz5r3mHw9EWXm8LgaKb+9BVF7EIcbKGIZKt/Tp/ZeZo8x8zq6/2I/T4Ot5p FebSL0gcp06++78Ld805EmB/n4dhadgWNxm2XcdGW8n1x6YNfd5g6ixig8CENkh6Wc li4QpwnZ31paw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYQ-001DrK-JQ; Wed, 28 Apr 2021 16:52:42 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Leon Luo , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 36/79] media: i2c: imx274: use pm_runtime_resume_and_get() Date: Wed, 28 Apr 2021 16:51:57 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") added pm_runtime_resume_and_get() in order to automatically handle dev->power.usage_count decrement on errors. Use the new API, in order to cleanup the error check logic. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/imx274.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index cdccaab3043a..ee2127436f0b 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1441,9 +1441,8 @@ static int imx274_s_stream(struct v4l2_subdev *sd, int on) mutex_lock(&imx274->lock); if (on) { - ret = pm_runtime_get_sync(&imx274->client->dev); + ret = pm_runtime_resume_and_get(&imx274->client->dev); if (ret < 0) { - pm_runtime_put_noidle(&imx274->client->dev); mutex_unlock(&imx274->lock); return ret; } -- 2.30.2