Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945611pxy; Fri, 23 Apr 2021 23:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlnOpsvWWNMfYUnO711z5uM+jVEyLOLwg0kqRhmugtop6Nw9MZjO31UtLsft+3Q4E3yaPg X-Received: by 2002:a17:906:dc90:: with SMTP id cs16mr7831871ejc.210.1619247389169; Fri, 23 Apr 2021 23:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247389; cv=none; d=google.com; s=arc-20160816; b=npejktRz78bZxz5X1PPKYDBMPLsolyvR9ZPEJG7mM0gfI4mvjMdZRkmuR+dvZu2+oH IId4ufwfGW2ms/rfg2vFStVLyCJ/Kd66ZllRCw0EFbaZ5IQganTAKdZ6S8HvOMto7KeL YmX25xn7UxDs+srUDz4SoB54qprXpRq7N08gvU7f8Nlg4zrdFHZQhexYXH4AaWs1GCoJ i86B4WB93aqx4G/tXkxZ4yhBWkF4BudeQbwsVfn1fIT9fsnLIjn56Cqh+1m+xMuBr8Jh 6OlU+6RIohN1PlUc67KBjBLhqUaXiKjN/8Rnfdl6YOKWjFo8wvezQRIpDQaiAaSbZK8Y vDJQ== 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=wXGOUkYOOE8eDy0arBScgP/6QM6Zj39A0sC7rb/tn78=; b=RN7p9ggw72/piGzE8AvnuYE1+ymzkzUN0Vd+uO9vMpIv74HGVOM/1ZP15Uk/OuTrrs nWqYLKYGEroTpVmQUllxS6On8GF7GQ8QZ8EJzBkmSv41tUx3bHecGBX7BtxraOP0MEWJ WVDyrgPpQkUAphylWOBJ619GxJOYiy11xwJ2ROtpYIghNDCOtEC+IYkrTGysEbGQF+Dl E2ER749JjFamqejElpAAQzEjM/BC3Dbhjnr5LrLClLmZfikmonwNfnju0BuBBwNINICf VPPg+v//VtufaYAqbGwO1BUqjyo18zlA/Ix8cLvBti6G0Quh4QFHc8DzmwV10hSkMfJt Utrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=i6qCu8gR; 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 p10si6858310edw.62.2021.04.23.23.56.05; Fri, 23 Apr 2021 23:56:29 -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=i6qCu8gR; 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 S231701AbhDXGwe (ORCPT + 99 others); Sat, 24 Apr 2021 02:52:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:35962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236278AbhDXGqc (ORCPT ); Sat, 24 Apr 2021 02:46:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E38686194F; 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=cJU/MoL9RhqbU2INYkiDGdONljhoe6cy+RDqPfC2nLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i6qCu8gRIIPTjBMFkmr+ZPHrywGeBFXC7aKpVvEK5WJAMAuyu/bYVg4vIAorvTG0i mBL0BNx9k5PXRfIxI2jRFqoAi8eN5SgsAj5UQqtgA1RD4rK31kVU5wSoV7Kl6cXory FldU9QLeU9vKPuLWtXX6zn8JrXGEnXbqbKLjKtUWjMwQo6yieZewvAJedFGvcAzirA /FCdrCJKNpGXgSSeg792CEU4QeqW8cWOpGT2xl9mhLbwfb5kldxjhb5CpTOpI6mUUJ 1eSYywIbfPn/XYNv1RB0oiBnCz+M0Yz6v1kkNO7Xq8uMfowGzySC73+aLUg4mO9I0b 8L4DdUIbiuyVw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jfe-1I; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Sakari Ailus , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 40/78] media: i2c: ov13858: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:50 +0200 Message-Id: <74288855f2b42ce83b27d3897a505470aae59ac1.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/ov13858.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 4a2885ff0cbe..9598c0b19603 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -1472,11 +1472,9 @@ static int ov13858_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