Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1462816pxy; Thu, 6 May 2021 08:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwzKXj6uAnAHvf7OU20driMuFkcscCHUxinTntFwKWpYvvdwhdgP9+YMBvMTCNn41qvSIC X-Received: by 2002:a17:906:b1cc:: with SMTP id bv12mr4961960ejb.407.1620314828469; Thu, 06 May 2021 08:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620314828; cv=none; d=google.com; s=arc-20160816; b=S8p9ZAuPa0dMgtJBYhBr9cJrWPauyvE7qFrjubtmgXGzpMxbISE2RxLxEQC6TB2gdm 32kf8su/VCLTb7n5qGFvn6YZXPryy8kxWeVHn5U7A//csvOt0YJ1zziioUrgEpiBXsc1 IFrxgaoTvqZyoGPg4vvTGDyMA8VpphZ0H0Cf7nbmFOhUJojtbVbxZPRPjXR6rsA/8U8K UML9oMftvsClXMcYnRMQolm7pZ+C2Gdc6gG+NFVxcuunt/fjtt5z0hsdVQiwNqo3trpS e0lEhle7tLBsw/QtnQPOxgI+D+TOZ8vaGa+X8Y6NhAgrSjr7PzeaFcQJEsHDSi9y0aPn khmQ== 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=PD6DG6VZVaotaBLhBWsDt9p4T7qsx5FB+3z2MjCLIls=; b=EGjWcvJn+xj9IEy5ObC3ZqEuWyzROAqCC2KRGb9LEp0Jg8ovxbseXWyKhynay/P8JL mwQt0s31WO+sLD/xZx3n+fqL+wssK/igXBA5DL7X2LnhcGr6Sj7N6AqErw6fMCVJZ6AE VwW8CiNGOrDoX26K+gmMvBYySGzb6dlu6HYzbC6HCaqDpOP7+bBbrB4a38+m45EIdeOu VAULtv53cJmcKEyWIvgvqui59BFE0nt9OpAR9rxItUTGVRZJgvC3trr/Srj0mCZQM+Dp 2GsX+8Jb1o8VDH3B+4MbKZnxzNNd32x034OLJn0+8g2gAubMeAuhAjQmz9a01DwQ/qIf ohYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=BOnhDxBJ; 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 r10si2836646ejy.100.2021.05.06.08.26.43; Thu, 06 May 2021 08:27:08 -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=BOnhDxBJ; 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 S235476AbhEFP0T (ORCPT + 99 others); Thu, 6 May 2021 11:26:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:38110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235214AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A587E6140F; Thu, 6 May 2021 15:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620314610; bh=k96A/wu5csXQdkebmEvDXUWzQhtBwXxGUFyh7/8ot0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BOnhDxBJuzXO1/Ny5BsRBRcNoERk1kShF5RTfedPyU5MFsLX6Tqms62D5jl1z/GT9 Z+CKzgecd6TGvHigx1VRZjWhMXZQhZ/XozKYZy7JkB2BrlpMLU7pXW3rmo7ILEdkp9 Hjo8eAoSTML2baWon6jitvsahSWYRMWTGnAPfAO05gfhercie6PApDU+ISxrhDvIAx ZTiH7jHbhrV65VmOTAEYNDXxeGIVU/mRpVsSxYhmXPdvCD5BRM9KhS6nA1chSUB2tk EN0Nj6O3lbxV6HDW58rwxZySKZ42JjWJc/LTyArfZRWjnZjZeHrxNSnYMmHfObm0xL T44uCnZBNpjoQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rvu-Nk; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Chiranjeevi Rapolu , Hyungwoo Yang , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 21/30] media: i2c: ov5670: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:17 +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/ov5670.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index dee7df8dd100..182f271f118f 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2347,11 +2347,9 @@ static int ov5670_set_stream(struct v4l2_subdev *sd, int enable) goto unlock_and_return; 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 unlock_and_return; - } ret = ov5670_start_streaming(ov5670); if (ret) -- 2.30.2