Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945978pxy; Fri, 23 Apr 2021 23:57:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjZYBGXTIDGh5wvpyehNhOdVhe/1M3wcRUCS942B9S+EtLBX35wbLwXtjAnnnUqJ+7TvpO X-Received: by 2002:a05:6402:2d1:: with SMTP id b17mr8546529edx.144.1619247435638; Fri, 23 Apr 2021 23:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247435; cv=none; d=google.com; s=arc-20160816; b=DrTe9oznZmXkDxb773fx+/4m6x3CO0ECnejNSJKN9apCJS91AZMtnJ4kksxtBQJQQ4 ayYWL2ga8UHyUR3aXRfHa3j/987BCbcBhBLnwzfdmWe9hpNbI6eT0/q6KF0cMzmb+qbg /+2epy3rcxSzr71NavEL4vUzCu5ZM5OevlA501FT817th2e8+tIU3lQtMe693gAzWoQQ G2wW0yujamTpB5S1d3CwR6AsSfn098K6om9wGVGpoZEDYooWxa15fS6O+AYCRMeEVMOA 8D1wvS/vb9AYHJh+PgzBXQWjmPFUrkBg54s9TknkKRl9FBC5esHlgvGTNbNBKJC5M9OT vzYQ== 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=U/NVyEVih0UeGt0TmV5NFxCGP5Of8yJI8psCw8wRc04=; b=XUw4MOoO19qMSF5vCClXXxLK88bjYf2Ov2T3Eq7D2I+ScCm/QTKZXnfBI+Ul4RObqB WIXjqX44FgDuX96FjAMG1Hoh9PNUlihifOLcBVF8YEXRHDiOBm7Kei4zDSQ6a4YyzgPL WtVGWKbSxh6GsCEhWdPt+Zwf1jB39yrFbSHXOhlsQBkGb9x+u3PmrBpupIBzPicr5RZ/ 5FpSkQRmNIHncWCOZ3vd9BNOCpG7r/ir4q7P2B9OUzgnQ1WusQfjy+FwdG+O/ljbomT4 twmssxSsiw2QDNB4giGXNdq6qxyCpAOqtZIXv+wyOrvSeie/lcKsBht9oUeFC2PpS89F hdFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="SLhe/um2"; 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 s9si7275037eja.133.2021.04.23.23.56.51; Fri, 23 Apr 2021 23:57:15 -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="SLhe/um2"; 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 S235645AbhDXGxY (ORCPT + 99 others); Sat, 24 Apr 2021 02:53:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236958AbhDXGqf (ORCPT ); Sat, 24 Apr 2021 02:46:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BBBF61969; 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=1619246734; bh=30FDfGkSRFbi6myOhgI3rDKaVJ2tBblGkl0/ENBmv/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SLhe/um2j1AMzBgnjx4G+kgBEfYHqSVrMYsBQ9ccOBOSlrCqkh+dweEuyQ/3WWUuz dCU2UCQnjw1/+IhzEgi7jxJxgIvq4RkxW/2Rhuf0EK416ZFX5W+EevV5mq4sWXsrh0 O1QHBoxJUOSN7aQIb7XAVwDXVzyDVgSgQOYEjUIr+T0A+KGY/p1PIp4RRaq/EX/a6s 7/ab/ct/rOTNViaCSFTok0ukR+YclaOSvKLse6HAY5FhrDNKrNldNs9HzPeBVV0MWE sIVs9yaAAxaI81P0Cgnbe3hfpos1qSYOZVDT1+uorQSMwbaDMot8c+bsa7dBvF8FSl +ZLnXMORV8XoA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jft-6D; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Colin Ian King , Dan Carpenter , Mauro Carvalho Chehab , Paul Kocialkowski , Sakari Ailus , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 45/78] media: i2c: ov5648: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:55 +0200 Message-Id: <849017f8db064802b02c5df3628271019f9c306c.1619191723.git.mchehab+huawei@kernel.org> 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/ov5648.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c index 3ecb4a3e8773..07e64ff0be3f 100644 --- a/drivers/media/i2c/ov5648.c +++ b/drivers/media/i2c/ov5648.c @@ -2132,11 +2132,9 @@ static int ov5648_s_stream(struct v4l2_subdev *subdev, int enable) int ret; if (enable) { - ret = pm_runtime_get_sync(sensor->dev); - if (ret < 0) { - pm_runtime_put_noidle(sensor->dev); + ret = pm_runtime_resume_and_get(sensor->dev); + if (ret < 0) return ret; - } } mutex_lock(&sensor->mutex); -- 2.30.2