Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944636pxy; Fri, 23 Apr 2021 23:53:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywzH3lfP53POlulWikCSImy/7WKQ+kSgT3XOn4O9F0BDCp3kWlmiE4KNNy/Cxh4eLfcz+1 X-Received: by 2002:a17:906:c83b:: with SMTP id dd27mr1841328ejb.477.1619247236282; Fri, 23 Apr 2021 23:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247236; cv=none; d=google.com; s=arc-20160816; b=C46DbcKe4Iz1VhHMqbYrlDpoAv6xRZnSDDRsicHKsKGTIOqVOjLGDVMOCm2ij5/kI4 ilnrmh+DHo8IjGR/1+W8Pm/SKSymhfFFWn+1+8BLqzxTfhZQDUgnRArzrogrI6nR0OzH NVAkYWnRZEjnWm90rI8Uv/HdPCrwUrlmHjNm7qzkG3AmsdmcCOki1T3/iT+B3uuRcIi3 lDD2Ppt0QvLD8gmNlGQuQwuJYRtaxC//BlI1BIoOK1PPoS3xagrMD/iSn7ufQArBAoSf 0IaBWBZ2o3nWJgmv2MJu9KDBiethqQhh2YTul5HAq6BASITj3iIJxtzuY3JoTw5M7dBi mjCA== 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=CYi1XA99pht57BbyNfgi9eGyD3etRYWVPM/dlArIQpI=; b=IC5d5v7FtT5xIti4ZXMPBqqQPLuvfeTBiK/6Q9DDjDnQqy330uRjFiWgKFH/dUOlj/ 3s9XJpocoUqkj/BeriUg3QkLd7CmgtTYyjiPS4yvVD3BdfyGYjJEgg56Ta/cZrJARV1z RMEqTpvrJM0K5Bf9lNf8ajjqAWDXJUYEyGO3xw3bI1ILlCHxP+MSh/CscayinUFRQFd/ Eg0Qe+RqmL8mCv4vLenzUzY8TgQvyCd4UGn+hcFDz8ydFDphoE89IaL9as1SfH2QfXZy eQdyU08gS4B7cFCnEIcr/NeWFoSViPb0735opIa58sGepYQTe3XpedjoQt28HuRpjvHm qYRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PVHdHZHK; 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 h3si2427200edw.187.2021.04.23.23.53.32; Fri, 23 Apr 2021 23:53:56 -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=PVHdHZHK; 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 S237603AbhDXGxV (ORCPT + 99 others); Sat, 24 Apr 2021 02:53:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:35790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236929AbhDXGqe (ORCPT ); Sat, 24 Apr 2021 02:46:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0785B61965; 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=zHjujpboN+Iu7V2XpqIB+1lLAb+rrUx5c1q69NYA2sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PVHdHZHKy32AJX6z0RlftLzQfQ9vmX2UAWgH/fiy6vaPsAUZifgwHMcrEHYl0YNEN oXVieMZe+1HnZ9swktNOb0CrBxEwDsIxv43UsCXyR7wLXzG65Mv6EI/UbROHWN3nbw enwErXQszrqrDbsipA7JJGYVR6WIh6Zt4ZosPzfO5Zbn7WSaEUDIppOEQ4SyL8ZqAp FYb4agfu81cseTYxdgAVmP80XJ3fkGehtJzgVmDb2vls/984Kl1z3mgAbzpkfNr9ek sQN++4m42Zsgid+Ji5Ov6GKkxkmhWwFkyMT2fcRWGn3nFnrKCmd6GZ5e0zi+f31xUd l3wPs3V1jt0Jw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jfk-3A; 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 , Shunqian Zheng , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 42/78] media: i2c: ov2685: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:52 +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/ov2685.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov2685.c b/drivers/media/i2c/ov2685.c index 49a2dcedb347..2f3836dd8eed 100644 --- a/drivers/media/i2c/ov2685.c +++ b/drivers/media/i2c/ov2685.c @@ -456,11 +456,10 @@ static int ov2685_s_stream(struct v4l2_subdev *sd, int on) goto unlock_and_return; if (on) { - ret = pm_runtime_get_sync(&ov2685->client->dev); - if (ret < 0) { - pm_runtime_put_noidle(&client->dev); + ret = pm_runtime_resume_and_get(&ov2685->client->dev); + if (ret < 0) goto unlock_and_return; - } + ret = __v4l2_ctrl_handler_setup(&ov2685->ctrl_handler); if (ret) { pm_runtime_put(&client->dev); -- 2.30.2