Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp621724pxy; Wed, 28 Apr 2021 10:38:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYqdxj+qbQadOx4R0a6hy6Sp9oTvP3yspC/volQNptQJ0Jzjj164Ky1A9ZOmbV4tlfvc0H X-Received: by 2002:a17:907:3f9f:: with SMTP id hr31mr29869518ejc.349.1619631376260; Wed, 28 Apr 2021 10:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631376; cv=none; d=google.com; s=arc-20160816; b=q9HTtBr8q+dv3tBAfC5VAYvaAUZ8jeGen8u1QSRodrAMUMMxlkDPLFWcGOTGJcrWwz 7ynUaA5N83sOczUZZfguGArInR6L8Ix9DtkQiJuL2hB6rxJCw+yDSct5IvQy4WhZwFS/ IwIhp5MrbVNZLzZhuIOam8PZ1iHI9h2p0fTQbUzIsNCV53p3htjFnEapXhCuunCEx1YM Xq0oyH5urw53bNqNNMW1tChVEUtwyxb3/MKg84RGmkPXMOgIag8yci3D/dabOvXDR7dq YiQkv4sVSS3atsZb1gh/sBE9Y38APqhBeE5Bcf52EbL+36GA9+cKrZQvUyaLhdRePjhE EiTQ== 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=z+CRtO6V8wkMfJ8tgSIMTmwEthZ08tL7kMK1jdCI+yA=; b=NzmtMKcYa4qh6/n5gxzrSjKfk2/rG9woQlkpzjHDawsVPguOCERkMog/bQ2cN2+cdp z/6GlfqnBJwU8TcGb4O5XgCrqbrsrB2CPK/qIAlzmkVammcK/7t67XxyB+o610EjBtg/ iiNxarlripw7GiCzkab+4kc/xzTbiRc34S7H2DwJFJqsSLrsEekDULkoQxjyTL64qDkD 5f/Wt3ze/2ShCncf2odnBrLSq3xTgM+RpiZ/Am/hUNfVWeZo0lw1mfzJFVfxH/xqAYl2 wke3BmRsV+Ta6bZhYAvswmKqpAdKjV50KF2N5puWR2JWG9jJNF6b3Q2kthSCeOlqjGus so2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=JBsqfn0q; 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 q18si631492eje.235.2021.04.28.10.35.52; Wed, 28 Apr 2021 10:36:16 -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=JBsqfn0q; 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 S240134AbhD1O4N (ORCPT + 99 others); Wed, 28 Apr 2021 10:56:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:36356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240324AbhD1Oxi (ORCPT ); Wed, 28 Apr 2021 10:53:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7994E6191D; 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=nPYpAR91E3rgdblnM1RIaAoqqFVi+fAvcFwJJ6A4j/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JBsqfn0quCCj3MqgqP6ZHRmkqOS3cmiQXdWx7T7zZvxWkECmOWn61aNxtzP/YPdU2 JV7UdHJdfL7nwkhIcDYqVHUs3gigUqilKVMPnpoj/qQndD4y6gb3qrDq6f0+FnLSHH rvpjEUrn4ZHAqhl1ItIrK1PBF0kkTXVhj1uaRXMwKd09NJERvdWAjNj2b2lWSdfnJB uLfPCFZMTnGsByeTuwSs2vnkCXXDCcCHhranB4WusZlPXy9w3aAKRATCesvBRpN2q3 /NfxRl6M/BzIccVtCJBfBWtvbBuTcoS17Ywug80fK5/loBkKjh5b9v6FKBcCL/XU4I o0gRz1WY4tQ2g== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYQ-001DrE-Hc; Wed, 28 Apr 2021 16:52:42 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dave Stevenson , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 34/79] media: i2c: imx219: use pm_runtime_resume_and_get() Date: Wed, 28 Apr 2021 16:51:55 +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/imx219.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 1054ffedaefd..74a0bf9b088b 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -1035,11 +1035,9 @@ static int imx219_start_streaming(struct imx219 *imx219) const struct imx219_reg_list *reg_list; int ret; - ret = pm_runtime_get_sync(&client->dev); - if (ret < 0) { - pm_runtime_put_noidle(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); + if (ret < 0) return ret; - } /* Apply default values of current mode */ reg_list = &imx219->mode->reg_list; -- 2.30.2