From nobody Sat May 10 06:05:17 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1620314634; cv=none; d=zohomail.com; s=zohoarc; b=WvhZERpqaolqfaXhhA0vqiyAg7ds5k0wn1ofpYl4lWmJdrTh0FkDcEwn3ktv+WlO2GTEHuLJ2zhBDFpEcq3Njyfnh9pKmxvBtxWzzscPJ3UEo0FIV2i/zXtSN28HF8KvZH28Utqw8CzPm66a3n/6xax4ahAaHNEFw2kvyEjNC/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620314634; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Sender:Subject:To; bh=47HdIqjUJtGUwQDpLtdDo2YUdcfQzgmDsHwVdQxtZ00=; b=lqethMfsaQg+hGVc970wcxPbMJumelvFHhZVR0EecrZ4x5wbjxmIUJI/TFXrJX7xUFGLOXtRqw0s+LE8gBep7bMEE+1S0/Lq1I4CKOpN/0FPF6DyhWbH1V8O0m20QQBbCD9DpV8efzztWc5u09pimufDbqGPfsZddicEgRKg9m0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1620314634563470.83558790653444; Thu, 6 May 2021 08:23:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235276AbhEFPYt (ORCPT ); Thu, 6 May 2021 11:24:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:37962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235106AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CB7461168; Thu, 6 May 2021 15:23:30 +0000 (UTC) Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvC-9g; Thu, 06 May 2021 17:23:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620314610; bh=uVFbSBsOFTlNeqpthO6c96NJAUfPhbV6UvOttxV6+5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ly6C76OpD8dXnmadzGR2BNB+zcZwkEwPVSaVQV+4gtC8Zr8Q6AHlofFIaC/K7T8Z8 nV8sLus77GlGExBjrIUVzhf/BP7BQ2QmIzOp+U774Fr0vHftY7O1gg1hSM9eYd3V2D 2iuU4k0XiBIqZgXEDYxrvaml0pxvKXXtNusgVLwkqMPjLpS9gxaJEFgJ1egVCBQFrF biZHbBUimBYM3TAWJWcG/Zl7/tfcRBUwHtyEk85NkeiNpTCeZe2KluQqMOHRFDQFGc dZhiDwZ76tcZQiQAGm5CEqalxfr3hCfFUFXuGUdiniI36ziDL8OhXUZ3q1H4o53DOc UvAPAlrGdId9w== From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 10/30] media: i2c: imx290: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:06 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal wi= th 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/imx290.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 6319a42057d2..06020e648a97 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -764,11 +764,9 @@ static int imx290_set_stream(struct v4l2_subdev *sd, i= nt enable) int ret =3D 0; =20 if (enable) { - ret =3D pm_runtime_get_sync(imx290->dev); - if (ret < 0) { - pm_runtime_put_noidle(imx290->dev); + ret =3D pm_runtime_resume_and_get(imx290->dev); + if (ret < 0) goto unlock_and_return; - } =20 ret =3D imx290_start_streaming(imx290); if (ret) { --=20 2.30.2