Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944603pxy; Fri, 23 Apr 2021 23:53:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyho6t2LgTx+YhrqUl+MbrRrsgiKTs8OTqGiDwAIWzxpUNLoQCeYDNqPKLK1UNxkEJjZs0d X-Received: by 2002:a17:906:4342:: with SMTP id z2mr7749840ejm.337.1619247230964; Fri, 23 Apr 2021 23:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247230; cv=none; d=google.com; s=arc-20160816; b=sN7NZLr7PAJjjaKu7FrJo8j2aTU3CmRvIey5ftZHhv528upQAtYxiqjq04QfCW9rGm A3P7HfGUT80YYqDubwyNIV+m33zvqTsa50hNYL2DcYL4vJXvvJ9pwjOFxWuLecMPEq7d gcrBohsj1s0j7T2SRY/CpM1zSInfT5MODnjs516rkpBIKFY4YXxUtZpyiEdPpFbP8qOI 2c4PHtfVSGGQrHFlx5Yd2eSNUiCOueKUUCv5jGnbc9D6WzhM1ZfLsUsraFuNXekuzsrZ mNQ13+bIxuOn2IaPRdVNoHs3pTcBnOWeB59nMleP2tVAwQN7Q7yNUhie8yk/X9HMWCcJ mlaQ== 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=dSOEoM10daHE4l7vWm5N/lgBLlAdUfkgG885M5nCQIs=; b=Hn0TgmkGwajGnxyvh4c6rqsUIP3dHN89VYHJNn7AABk5OZxX1T4tSuFjN0mX1BZJi5 QuPME4VoAe82f2yiQ3CUiiDK4r78YH+8lSPrnl6sG0Kpd/ToM/VjswyH3tprIAAprt2e 3PV7jK3XSKCLXVjYMMkwWwbq9GeND2AzeCTekLw6Sq0Uc1zt3ez79tkf/N5R3sj9sbfY EMHl92kfynP3cp/seRtnS+h1iR+3RjYwsmrb0xnsMPAHy0PY4BOM13tD5IaaoMjTmDjH Q6tvBBeaPmPSXubkCVULnMxFTQOYnCqVEVhka+mv1ozAo8NpHJ5YpyqNO2SrvzEmw5tW cIHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=SKUkQWMF; 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 dd17si7273405ejb.433.2021.04.23.23.53.24; Fri, 23 Apr 2021 23:53:50 -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=SKUkQWMF; 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 S237330AbhDXGub (ORCPT + 99 others); Sat, 24 Apr 2021 02:50:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:35796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233280AbhDXGqQ (ORCPT ); Sat, 24 Apr 2021 02:46:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B0C0A6192E; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=6SWDMHkSlrYNzq7GtPd5DH9pbQJCAbHbxO2AKYAv8vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKUkQWMF5xRvaRZUnhogiYC6mCr50zuinV63RwxhjdIx3FJyP0HD78wtO9cxLvQwN cGitAVtNSuEEkWaokoW6jcsf7SphEFKD1vRYOgL7250hDlCdnI8hSSDPtfbybCyiNR eQNNfSqr6s/xslALy0HSvEsZz+HRA84kL5J/HtZR4Sd6Vz+5YtvfvKhsbNVXhtuUUD /Zaipy1RQutFQyaPCuzZ+DAV4ctL4rseJwM2/YBKj6v4xfjxkY2uFFTAcmYlEm4uZ1 zhUXNp+EtGyNMJfNLkJ/0zWJzCaMYwd2BOKqFcZBOtnHtS4GGMp1YtbwsnDeToqDaD E72gtfSJ5a9sg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JfP-T0; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Bingbu Cao , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 35/78] media: i2c: imx319: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:45 +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/imx319.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx319.c b/drivers/media/i2c/imx319.c index 38540323a156..4e0a8c9d271f 100644 --- a/drivers/media/i2c/imx319.c +++ b/drivers/media/i2c/imx319.c @@ -2141,11 +2141,9 @@ static int imx319_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - 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) goto err_unlock; - } /* * Apply default & customized values -- 2.30.2