From patchwork Thu May 6 15:22:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01622C433ED for ; Thu, 6 May 2021 15:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B15A26109E for ; Thu, 6 May 2021 15:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235189AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:37940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235063AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 29E83610C8; 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=88Q2GGxTdA6m8Rsuuzf1i/TAz4J4CJAtybbFo3TSOco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rX8XPqzS9ObsqJaPbrNX5iV1hxAmS8nPVdCIboWyo3eogd4cfA81zk3BXQgMrjXTF 3J9I11YIasoRCkSG8+KWP4nNwFloVjGG0O2L+bxIbnR1A1Ocyd0y/8+X60XvXOJQWM McZQi9Znj+zRMmqgLlwoH+Wt5C2/a/xd1HjwI2xwwUz0zqMtvlPnokW8+gWXfxwIey pa4RUxdiZfhBCWY5LCRF2IxRRrw3xAzPXsk9Bcous9WNTxDhgzo7Xsw2h4Xsvrggg+ 5mdEjvFdK1oYTOLyVM7dY6ZbU6EeYslc7AFKQhci2TKgBs8FJfkeYaKpPmucUkQXS7 ALHa0G33iY4Pw== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RuY-0J; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Tianshu Qiu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Jonathan Cameron Subject: [PATCH v5 01/30] media: i2c: ak7375: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:22:57 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ak7375.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/media/i2c/ak7375.c b/drivers/media/i2c/ak7375.c index e1f94ee0f48f..40b1a4aa846c 100644 --- a/drivers/media/i2c/ak7375.c +++ b/drivers/media/i2c/ak7375.c @@ -87,15 +87,7 @@ static const struct v4l2_ctrl_ops ak7375_vcm_ctrl_ops = { static int ak7375_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int ret; - - ret = pm_runtime_get_sync(sd->dev); - if (ret < 0) { - pm_runtime_put_noidle(sd->dev); - return ret; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int ak7375_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) From patchwork Thu May 6 15:22:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAC49C43461 for ; Thu, 6 May 2021 15:23:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3CB861177 for ; Thu, 6 May 2021 15:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235279AbhEFPYt (ORCPT ); Thu, 6 May 2021 11:24:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:38112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235191AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57B6B613CE; 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=yvRexqPmybCXcMQCunEHPJjJgD+ZEwM3R67ntrsgrMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gEbsIt1wQsi7H8MVCLEl6Tvz8epkvLKbkcuDKyNixCXJh1CHOf2cWHwHOCzkMfQrz d2KL14L6A8k4HrkMe9sW/thHPAgHPffd+gbGhZ+qtsNB/PWo9qZP0PITShDRY6DTl9 T/gx227C/4EulHRvYWc1bRxoB7ChBueWYeUgkPILaLJXlzXIL31KmzJy+WgFhX4Vb+ 6TDLo7JgOac7Cw1KJpmVA1Zc3x2TwqCg+bQqW9EqmHN9tqFb/csNJJFBsx/dNykCUd kVz04Z9tYkgumWDTIXNg3MNvKmht0bhxxCnentVyP4ujCWsQSReEHKazCYStYAQPcv O4/QBRa/CsftA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rub-1O; Thu, 06 May 2021 17:23:28 +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 v5 02/30] media: i2c: dw9714: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:22:58 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/dw9714.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index 3f0b082f863f..c8b4292512dc 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -85,15 +85,7 @@ static const struct v4l2_ctrl_ops dw9714_vcm_ctrl_ops = { static int dw9714_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int rval; - - rval = pm_runtime_get_sync(sd->dev); - if (rval < 0) { - pm_runtime_put_noidle(sd->dev); - return rval; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int dw9714_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) From patchwork Thu May 6 15:22:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D204C43462 for ; Thu, 6 May 2021 15:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60688611AE for ; Thu, 6 May 2021 15:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235253AbhEFPYp (ORCPT ); Thu, 6 May 2021 11:24:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:38090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235185AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 45E02613B5; 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=0+qUTNue9hnyAq3YJfJJPyrh70EsjiwzWG3y47ywjxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJDjeZrgHnulehCh8RoFTus6HzOpJ6yGQ5VvYrlU6bt4s45pUsH+A5eQx84l+qKdf V6bplUoKIvy20sSrdMQ93JibW/GeL//gEDmmguzOcaLnP3TkVKEsp/yF7B24jcUBnw o4jgqIWi3UXvAw71C6VLgk2DZ5uxDPpFqB93XPHgAFivjDvrRg/u/Sjza94oqP/QMJ 6CqS4O/YTpajM4M1B8NXgbv+OxUft9GfYxL8BGg2LIL/vDHCOqNuTVCh2P3T+DZxDn hjZDd1okl8500E95SG4j0SNgx0VgOo2wbOymMRhkXGkW5nmUlMeu8BTJx26Q0HFunL xCo0TWiYbDTeg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rug-2O; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dongchun Zhu , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 03/30] media: i2c: dw9768: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:22:59 +0200 Message-Id: <29c8e9ffa2ca7d1472e8ae14ead4726cdcde9d96.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/dw9768.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/media/i2c/dw9768.c b/drivers/media/i2c/dw9768.c index 8b8cb4b077b5..c086580efac7 100644 --- a/drivers/media/i2c/dw9768.c +++ b/drivers/media/i2c/dw9768.c @@ -374,15 +374,7 @@ static const struct v4l2_ctrl_ops dw9768_ctrl_ops = { static int dw9768_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int ret; - - ret = pm_runtime_get_sync(sd->dev); - if (ret < 0) { - pm_runtime_put_noidle(sd->dev); - return ret; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int dw9768_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) From patchwork Thu May 6 15:23:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 071A0C43470 for ; Thu, 6 May 2021 15:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7FA261168 for ; Thu, 6 May 2021 15:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235285AbhEFPYv (ORCPT ); Thu, 6 May 2021 11:24:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:38108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235186AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4171B613BA; 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=8oeNDL2f6ftikmJG74aEJuwd7JVkpDOtWW3l23y+D78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CIzENzWfaB0L+SKXuNxft34UX8O8DNA4M3oCFRiVyqx1Mbqj3SJHBDlryaaFfxzh9 kemioLf9ziHYYZM3XjT82Wmw1nmpOhiUlHGNeE/LvmyMdqhxROLHxg+pbMWr/dSp4B XtxYjt6k+q4/iOtWnoZnobyB5sTIBY8qQ+Qj9JmoBExV7YjGrNhiuqBYl5+vgNDGvO gt2Us769gmIIJdFTP0wgAuZnvGouGIZrk9zBEUh/vIhmraSIl076xMMD8Ue+tIJJvX u57T9wwOQoaI4JpKr/wbNVZ+A5u3ItjoMi0NLLBFU6GWhfZ6vbNCCK5zrrqyXfpdGY +76d/ose27+6g== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Ruk-3H; Thu, 06 May 2021 17:23:28 +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 v5 04/30] media: i2c: dw9807-vcm: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:00 +0200 Message-Id: <351da21914f18f849f4898f948731b08dc1a3693.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/dw9807-vcm.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/media/i2c/dw9807-vcm.c b/drivers/media/i2c/dw9807-vcm.c index 438a44b76da8..95e06f13bc9e 100644 --- a/drivers/media/i2c/dw9807-vcm.c +++ b/drivers/media/i2c/dw9807-vcm.c @@ -130,15 +130,7 @@ static const struct v4l2_ctrl_ops dw9807_vcm_ctrl_ops = { static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int rval; - - rval = pm_runtime_get_sync(sd->dev); - if (rval < 0) { - pm_runtime_put_noidle(sd->dev); - return rval; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) From patchwork Thu May 6 15:23:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BE21C433ED for ; Thu, 6 May 2021 15:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E9B1610A5 for ; Thu, 6 May 2021 15:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235208AbhEFPYc (ORCPT ); Thu, 6 May 2021 11:24:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234993AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 243436101A; 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=28FtFakpR3rMJfq6Bb1gqJsNDZKdyp2sz2lduteJODo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EIXNtW33l+LoZwDbDUNv2+xeAbbe+gVCQs0EN+iD+/4nflmVUXiTahCUcSzBNBDMO bQvXGpOfNaaJfTBTOPoYzAd1EJykisK+vPoGEHHrbm6++qdx3Qah1IgKwCfCjdVxyp Hnzk+X6N0NexJ835tgoDDnYRxIjavddEci/3aknfHCZI0OcvK7l8y34pLtVRYUwrr4 rE7xs7kY1pf3NUkg0K47HxB84Ma+hwFZ1/ydbqfgl4IXpfXHTG8BIZfaj/A00kvUyC ih7Ai3RGWMCpb7m+AJ+6XEQvsxq/PPemmvGuX0EYV0UpI/tEXe8MSQ604C8GYKfm02 eRTnns7CUrCeg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Ruo-4E; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Shawn Tu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 05/30] media: i2c: hi556: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:01 +0200 Message-Id: <8b729e702a9e3416a66bddd5f42d89e117bd1618.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/hi556.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c index 6f05c1138e3b..627ccfa34835 100644 --- a/drivers/media/i2c/hi556.c +++ b/drivers/media/i2c/hi556.c @@ -813,9 +813,8 @@ static int hi556_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&hi556->mutex); if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&hi556->mutex); return ret; } From patchwork Thu May 6 15:23:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B14B9C43460 for ; Thu, 6 May 2021 15:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F92E613B5 for ; Thu, 6 May 2021 15:23:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235318AbhEFPYz (ORCPT ); Thu, 6 May 2021 11:24:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235199AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 522CB613C2; 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=KnK+ScvrOSmF+XC/C/B4F8IBvu/svp7LsuDeKcM5sXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fo3mpoIwlF2YTmD+DnpzMqX4qAaDKE8ReBIJbDjDgurF4qfc0UJ6br3Ir90R8RRPW a6hiP92P3yyHTN2KESUN776tbfFmmeIkhh2Vyeg94xZzGcT1VSJQZR6NSAKRQk7mvK bnUPM9gSlPyxXEwNgtu24Irp29vV3aKebhYk//O3524BX0dYUKChL/rXZL9SC4oDbK 5DzP2t/iuW3wvu4XS3Qrp6PhVu5wC+Ud+ojS/j26oVb0bGn7CvJx/jf8mr0Won0Syl kQJ/AbyUTltr6+H9p3qS6TCVrJPk9RyvMHBdvr9VKWFEcqw9JUVSi5koYKG9c2oEVH kJ1qHtxnxsvjQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Ruv-5B; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Ricardo Ribalda , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 06/30] media: i2c: imx214: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:02 +0200 Message-Id: <057abf87cbfc71a7d4b40db8ef3c72f200e56ac6.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx214.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c index e8b281e432e8..1a770a530cf5 100644 --- a/drivers/media/i2c/imx214.c +++ b/drivers/media/i2c/imx214.c @@ -776,11 +776,9 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable) return 0; if (enable) { - ret = pm_runtime_get_sync(imx214->dev); - if (ret < 0) { - pm_runtime_put_noidle(imx214->dev); + ret = pm_runtime_resume_and_get(imx214->dev); + if (ret < 0) return ret; - } ret = imx214_start_streaming(imx214); if (ret < 0) From patchwork Thu May 6 15:23:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C36EC43460 for ; Thu, 6 May 2021 15:23:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 499E76101A for ; Thu, 6 May 2021 15:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235270AbhEFPYw (ORCPT ); Thu, 6 May 2021 11:24:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235198AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 49397613C0; 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=nPYpAR91E3rgdblnM1RIaAoqqFVi+fAvcFwJJ6A4j/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G2D5SjYUp1dulyJdbit5nwxPotB7SPsw8eSZ21eCcpRaLZSYJYR0TjnXhxMyskY6N S919sO/uR0Qak+mzvXO2cI8IJNINLib4b2Sx1a0irZIaIOAXKiwUtgKzKF0VPADhSn k9c9Sdn/ZLWjsANMxSd8hknFlr9AgvJlon55ycnBRp0T9enH/cnPh7DKwYT/LvdCaW pQ0jL4G+MzotSryLfcWSFBZKFNxuPN6G/5LfJTjwYSvf//4fR4GCQmn+DVJy9DoJvC cLds3tRxTpE0WenRaJLMp88URO8YT2ARcJaVPORj9qroC3DQGjLSfpfNJLZBPPlV1X rqDaikNanF2YQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rv0-6Q; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dave Stevenson , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 07/30] media: i2c: imx219: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:03 +0200 Message-Id: <8f44c30dcb991df458e9a4c6ff833c1dcaaff897.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx219.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c index 1054ffedaefd..74a0bf9b088b 100644 --- a/drivers/media/i2c/imx219.c +++ b/drivers/media/i2c/imx219.c @@ -1035,11 +1035,9 @@ static int imx219_start_streaming(struct imx219 *imx219) const struct imx219_reg_list *reg_list; int ret; - 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) return ret; - } /* Apply default values of current mode */ reg_list = &imx219->mode->reg_list; From patchwork Thu May 6 15:23:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0F6BC43460 for ; Thu, 6 May 2021 15:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E41D6109E for ; Thu, 6 May 2021 15:23:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235231AbhEFPYk (ORCPT ); Thu, 6 May 2021 11:24:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:37980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235122AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3787A6121F; 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=eHVLTLMHsH9CniLLDWRCODM0fRuiKeyCHa5RZsztWV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U2/LY5FDlM0rE1ytMfxR/4ENh1Rz5px37uchIJ3oNTdiYKW/DjiPpCrXlGJiYm7fM 0+kFLuNa3nNvw9es3c/4Gy2DIUpD+jgYmtUVF7KmLE5Bpmko7sKW9Cide5bMetF/3B gueG3L30G/8W3muFtNNenosxtS7NO5Rv128T0+lH75teIh8sieGUACyQFbjpw6v1hU leihzp2WOlNLH8XSn19JGYYk/IHl8Xcht2mLr5lWAuByezf9MDZbrVzUzNdAUdSaby aIbl0jku3Pwz234VCicOlBSygdpgUNX2i1WaujRD2OJfeJffaB7GekjmIJ170RdqyY aEOY6eYcUX9bA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rv4-7V; Thu, 06 May 2021 17:23:28 +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 v5 08/30] media: i2c: imx258: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:04 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx258.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c index a017ec4e0f50..90529424d5b6 100644 --- a/drivers/media/i2c/imx258.c +++ b/drivers/media/i2c/imx258.c @@ -1039,11 +1039,9 @@ static int imx258_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 From patchwork Thu May 6 15:23:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE069C433ED for ; Thu, 6 May 2021 15:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37B9F6101A for ; Thu, 6 May 2021 15:23:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235247AbhEFPYm (ORCPT ); Thu, 6 May 2021 11:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:38092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235184AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35714610A5; 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=RKkiGoCDSW3lMHxV9n7JS+4PruB0khbogVRD1m+DqBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+LlJTlUo2yvHlyAy49eNF7OYXRW3jPYNTM0ikesVnrrhWZNlJfoMiDb8cRW/Sf4F VuptXVTmoglEnlwiOhmKzRulppGeNU0kV+TvVBlWW0XsNE+Sqbi4WdQzl5ChLkIJon O3aHqt6MjoEN0JZjiqPIplYKoKXVD4RIUAJ4VS0qqg8XmbrBo/JK4CODUBBUmCx2Rp y7j7r+wHgX/j+JnzRljtftJRuoEMLEQugj7ddJ/POUnb59VtxszRdPsQ1dbrvCDE6K OM2fBOiizN/Cp8d5DN6nfJ55Vm8RrI4L6fabc9O97rXlRBeE6Ef7H3donauI6PnpzO 7cw77wTleUQxA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rv8-8d; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Leon Luo , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 09/30] media: i2c: imx274: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:05 +0200 Message-Id: <6ac82723b9c6428fc385981822ca14e72f793ec7.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx274.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c index cdccaab3043a..ee2127436f0b 100644 --- a/drivers/media/i2c/imx274.c +++ b/drivers/media/i2c/imx274.c @@ -1441,9 +1441,8 @@ static int imx274_s_stream(struct v4l2_subdev *sd, int on) mutex_lock(&imx274->lock); if (on) { - ret = pm_runtime_get_sync(&imx274->client->dev); + ret = pm_runtime_resume_and_get(&imx274->client->dev); if (ret < 0) { - pm_runtime_put_noidle(&imx274->client->dev); mutex_unlock(&imx274->lock); return ret; } From patchwork Thu May 6 15:23:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6C24C433B4 for ; Thu, 6 May 2021 15:23:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86DD3610A5 for ; Thu, 6 May 2021 15:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235227AbhEFPYj (ORCPT ); Thu, 6 May 2021 11:24:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37962 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235106AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2CB7461168; 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=uVFbSBsOFTlNeqpthO6c96NJAUfPhbV6UvOttxV6+5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ly6C76OpD8dXnmadzGR2BNB+zcZwkEwPVSaVQV+4gtC8Zr8Q6AHlofFIaC/K7T8Z8 nV8sLus77GlGExBjrIUVzhf/BP7BQ2QmIzOp+U774Fr0vHftY7O1gg1hSM9eYd3V2D 2iuU4k0XiBIqZgXEDYxrvaml0pxvKXXtNusgVLwkqMPjLpS9gxaJEFgJ1egVCBQFrF biZHbBUimBYM3TAWJWcG/Zl7/tfcRBUwHtyEk85NkeiNpTCeZe2KluQqMOHRFDQFGc dZhiDwZ76tcZQiQAGm5CEqalxfr3hCfFUFXuGUdiniI36ziDL8OhXUZ3q1H4o53DOc UvAPAlrGdId9w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvC-9g; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Manivannan Sadhasivam , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 10/30] media: i2c: imx290: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:06 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx290.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c index 6319a42057d2..06020e648a97 100644 --- a/drivers/media/i2c/imx290.c +++ b/drivers/media/i2c/imx290.c @@ -764,11 +764,9 @@ static int imx290_set_stream(struct v4l2_subdev *sd, int enable) int ret = 0; if (enable) { - ret = pm_runtime_get_sync(imx290->dev); - if (ret < 0) { - pm_runtime_put_noidle(imx290->dev); + ret = pm_runtime_resume_and_get(imx290->dev); + if (ret < 0) goto unlock_and_return; - } ret = imx290_start_streaming(imx290); if (ret) { From patchwork Thu May 6 15:23:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AEF0C433B4 for ; Thu, 6 May 2021 15:23:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 426836101A for ; Thu, 6 May 2021 15:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235239AbhEFPYl (ORCPT ); Thu, 6 May 2021 11:24:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235178AbhEFPY2 (ORCPT ); Thu, 6 May 2021 11:24:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C23D61177; 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=6SWDMHkSlrYNzq7GtPd5DH9pbQJCAbHbxO2AKYAv8vU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NamKeKL0zZGU3VlGfsCYBEGN2ntfsKvStp8IUKnJaojJDu+VOIgPzDvBjOZ74NclB 8oytSGQm0MWe5nosHANf2KQMTvGJsDm4/9Yf8HM4qRjfXT0ndKA/lV+iQYQsRysXrJ ndZeILREKhavxS8bntdEsfVIdXgqWuuIb1XUk93MF15VZa6kEESG8wJI+zdUAPPJnF RBVANKn8BW6clquRGNVF2Q96LzWNglbvfZehHOmgaZjtUTlATnwiqeYZPTumMG+JJd waACDIDMoqNMuUJNrblRokKYPpj/bMTS6YYTIPcyDsdFnJGVBew4kjTXDu8srKcfnc gQfy4cI3wlopA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvG-Am; Thu, 06 May 2021 17:23:28 +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 v5 11/30] media: i2c: imx319: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:07 +0200 Message-Id: <631cf6f69192033e4b45133d0c7cd9f057076049.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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 From patchwork Thu May 6 15:23:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DCB3C433B4 for ; Thu, 6 May 2021 15:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06F976101A for ; Thu, 6 May 2021 15:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235261AbhEFPYr (ORCPT ); Thu, 6 May 2021 11:24:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:38114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235192AbhEFPY3 (ORCPT ); Thu, 6 May 2021 11:24:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50515613C8; 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=M+G2FGvpxz8oVs70Hd7XJ+D2QZDVSmESzfk8hhosPRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZnH/Jy7ZjVGPRC4YIfOXwYpvurWTkTr8BeeG1hd2dT70CwxbugdZu1srV5X9veiw1 XPASOVTZ2yumX7vu1bSQRbIOp7JX4e0nb2nW6bHOQDUOiL9IZFLFYouMstzz1R4YtB K8rFuiRGiJw/uAQs5yx04kuN3FQ2MHMthQYq1LiGpWw2l0akV8ssdeiLQBK3FfY+Ek qb0HruJ42WRoC9Svg80zs+PXaLBiq6wWQ7RzDpOePFBdfw+q98oODNpnVUhNkFYMU/ ziA+FLrsCNtX9OwdX8eY9VGM8z5OCiJ/+oCLxGAyAkUXvvzKzNyv+2B7lzsuRR6PEg f0MxEfbgImy3w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvK-Br; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Tianshu Qiu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 12/30] media: i2c: imx355: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:08 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/imx355.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index ccedcd4c520a..93f13a04439a 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -1442,11 +1442,9 @@ static int imx355_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 From patchwork Thu May 6 15:23:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 258B4C433B4 for ; Thu, 6 May 2021 15:23:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 180CB610C8 for ; Thu, 6 May 2021 15:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235290AbhEFPYw (ORCPT ); Thu, 6 May 2021 11:24:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235194AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5259B613D6; 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=/7W/4D4Cg4pCxHEZGuCJQ5dkGl7p2HK4IsN3mgaNluw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tQ4R55NhcEmhgwPD+YxHuSRhF87CqsZWODJTKE1snxuW1bRlxU7H49POkm++QU6WN IFBlP/FSQi6VgncF9xPgGngjKqeaeEEaSr+JrF4u+YDS2SDBUrsuv27Du3GV3er1ol qBPaMSEYDf0yTGHEAy9wZ7PF0xtJ+n+4EnrhuXJGQuePGrtXkT/1IVy7Z+2sUosHX1 8FVnzJl9/0exitPZF642OS6JtjoJ+03dee6SUM/IKE78U7RcAx/QOh1pvI41qt2Wun RY+EXU4GVsbi26ncgNjyLaL+74j33xoMQB0hGO5eC05roQYn7/oWEO7Sdu+TBI9lqm XR9vvCiWOdHpw== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvO-Cv; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Hans Verkuil , Jacopo Mondi , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 13/30] media: i2c: mt9m001: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:09 +0200 Message-Id: <45d7459c994ea66c0a4745ca5a105e7cf1129575.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/mt9m001.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/mt9m001.c b/drivers/media/i2c/mt9m001.c index 3b0ba8ed5233..58c85a3bccf6 100644 --- a/drivers/media/i2c/mt9m001.c +++ b/drivers/media/i2c/mt9m001.c @@ -217,9 +217,9 @@ static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) goto done; if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) - goto put_unlock; + goto unlock; ret = mt9m001_apply_selection(sd); if (ret) @@ -247,6 +247,7 @@ static int mt9m001_s_stream(struct v4l2_subdev *sd, int enable) put_unlock: pm_runtime_put(&client->dev); +unlock: mutex_unlock(&mt9m001->mutex); return ret; @@ -834,6 +835,10 @@ static int mt9m001_remove(struct i2c_client *client) { struct mt9m001 *mt9m001 = to_mt9m001(client); + /* + * As it increments RPM usage_count even on errors, we don't need to + * check the returned code here. + */ pm_runtime_get_sync(&client->dev); v4l2_async_unregister_subdev(&mt9m001->subdev); From patchwork Thu May 6 15:23:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 096FEC43460 for ; Thu, 6 May 2021 15:23:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7F4161168 for ; Thu, 6 May 2021 15:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235272AbhEFPYs (ORCPT ); Thu, 6 May 2021 11:24:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:38130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AF35613C5; 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=rXQEV5ur3+5U6VOB8wAB6dlcXqNLqRBsrKFm5rfs1io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzY8sIrfOL1EBbfNSwi0NaG/MVAGloYbNLH6LOHrWLIrd459HN3w5cYlxIbxTQd/B 9ahkuC89Z3Dki1l4Uc+Uzz7MHxGTjEPC4x4+t8gI4+dPUlgvdPqF1we5hXpWMp72qK T94SYEjWtIzw3ukgmom5oJ9ZSEQ56G4c+Nfx4CHYc4Z2wnBplqP54CRtJkeaMO/fJ2 /rVJ8a2AweeIgzHDNP3d9CEtapOQUIrISbFlRRxNkyU0dXTfvjrgWWgF81slv5owkb 0ovpT9F2eaLbcrd0o677Lp0tJEZUFeGCCGUNo3CzJr8eV+FXaxsO+vF9fw//N0dhuM YhvHXG9rH2hlQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvS-Dz; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dongchun Zhu , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 14/30] media: i2c: ov02a10: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:10 +0200 Message-Id: <63250c8ddfb2b26ba3e8251cee1bbee380677388.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov02a10.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov02a10.c b/drivers/media/i2c/ov02a10.c index c47b1d45d8fd..a1d7314b20a9 100644 --- a/drivers/media/i2c/ov02a10.c +++ b/drivers/media/i2c/ov02a10.c @@ -540,11 +540,9 @@ static int ov02a10_s_stream(struct v4l2_subdev *sd, int on) } if (on) { - 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 = __ov02a10_start_stream(ov02a10); if (ret) { From patchwork Thu May 6 15:23:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D255AC43603 for ; Thu, 6 May 2021 15:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC03A611AE for ; Thu, 6 May 2021 15:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235324AbhEFPY4 (ORCPT ); Thu, 6 May 2021 11:24:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:38090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235203AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6302D613DD; 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=cJU/MoL9RhqbU2INYkiDGdONljhoe6cy+RDqPfC2nLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UyCbVExH+NwBj1QdDOx4732l++dPlXl2AI3D9IaSiXUR2om/2OIUBSLPt7fDvS/eI oAVBYhQUhRUCCm08M9MCnpMFqZAQoKR+ldG+x4i+2KnKgc2K5l/CHlB24k0oOmlaHU VWgwZCb8nZcAZPc+8MqgWzLzJzSps5w5/5VWNBNyxWfboKKqCFUZWrdE0IIXLrqqkO fChAiecs4PwbBwnll5q8duaDj3qSQZIvG1DSbWb8IRIDDMpoXEmpSo19+8jiHby1fw ZyYlPmQBYcid2vURirsFVZe+7TkRwJH7X3/NTUxEq/2NP9nxUqHqOpECEAVcLDxQf6 9wvRcWOUaav/w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RvW-F4; Thu, 06 May 2021 17:23:28 +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 v5 15/30] media: i2c: ov13858: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:11 +0200 Message-Id: <3378b00f77814d32b48dbca76066eaba5c1bcc94.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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 From patchwork Thu May 6 15:23:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC467C433B4 for ; Thu, 6 May 2021 15:23:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBA79611AE for ; Thu, 6 May 2021 15:23:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235300AbhEFPYx (ORCPT ); Thu, 6 May 2021 11:24:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235201AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 646A1613E4; 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=oKyS61glPZn5sXxnrboa/AtTlnD1fG/1xuau3yVfL78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3COkbEQio84liZvUPD/J3sUZsnfuPrbg5MZknOresXKFtUmxMuZxFvoI/kS6yy6Z a6nGESFr4PMEFiV9zu1onxngOe/kuoyvJGX1COR+hIC3s+mWrsGQeThD/uy8ENUdCR adk1WUekooG8SbWcZ49+AcUZjo4o3DZ6XPdy+KWTGw1lLQsOtG86KQNcchRRqfIbYC AFcioGeR02XmDJrdM2o+NJCs0FgZjafED8Am/bzE/AOMDzltaSUbeQ4yefJHRXkf7f enWuikh/i3jFea7Psx5mtItnTwckemveGfu3j+2AUvd3HRaqgCUKDUCdWSlCFpzUw3 Fe9OpzU7UxL/w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rva-G9; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , "Lad, Prabhakar" , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 16/30] media: i2c: ov2659: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:12 +0200 Message-Id: <6c19955672011ff88748e3314e984a39504d1622.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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. Acked-by: Lad Prabhakar Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov2659.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 42f64175a6df..a3c8eae68486 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1186,11 +1186,9 @@ static int ov2659_s_stream(struct v4l2_subdev *sd, int on) goto unlock; } - 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; - } ret = ov2659_init(sd, 0); if (!ret) From patchwork Thu May 6 15:23:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1420C43616 for ; Thu, 6 May 2021 15:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C6C8610A5 for ; Thu, 6 May 2021 15:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235332AbhEFPY5 (ORCPT ); Thu, 6 May 2021 11:24:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235207AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 73151613ED; 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=zHjujpboN+Iu7V2XpqIB+1lLAb+rrUx5c1q69NYA2sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tnB+O4letHgY5bxfTxCUe0bswQI7Pl67U9osdY94TDrknu+ifQ2KlKz7XjTswp+BK Y6Lsw4ZMOcsfX3hT0bGLRv/q5385GbGfzr14B9u5+abvkNgnoDNbhZ5yTG+0C2GSL9 dx5ACXxuHV4LsSMUI1cSVf882t1TBiN15+loKkaSHBUrxIT4cyZFInplqxQnYkNSE4 u85nJUAOeuSpGFyVWjBuzGg/a1TvBcFSmP6lEfitF8VkYPjL9An1gV/wDIx/en8sdp XXCsDAy/AWfEuyxccQ3gz85pvEACkFVqdHYt+et8mVLQCmkCSy004vl5dtiv4uwbaH sgXPQbVj+8Jgg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rve-Hy; Thu, 06 May 2021 17:23:28 +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 v5 17/30] media: i2c: ov2685: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:13 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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); From patchwork Thu May 6 15:23:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87EA8C433ED for ; Thu, 6 May 2021 15:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FE7D61177 for ; Thu, 6 May 2021 15:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235309AbhEFPYy (ORCPT ); Thu, 6 May 2021 11:24:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235202AbhEFPYa (ORCPT ); Thu, 6 May 2021 11:24:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 69FAC613E9; 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=7OrVLmuptLSsOu7s7HI3z0Br6sbVW37gaZRXQvAtXI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nYWWDlT1SdBEFXVLO7MMgpG5Zc7VvX06rzkajtQBGBPlhR/qFYEbKYPDRYWRNNuNR UDoeJ6Cw16+tVD4Z9QFcgbDnDgRuCLWIwwTd03Idltu5UtVrdo4xn7jVFJFQll2obM SHHNpk5CJwCORJVFpJMQ/uoLbVN/tS90jaQ5rDebdt7VhCHNrpT5UL9kNBAkiRMIHO Oh5foOBJskXayrOC/bHqpUi3v38xE1Br4Di1Wj/ZYnd59SMjrEoDV2pAhaqLZHr8JX WSfqaoBXApWv9oCUljDQzQ6sBpyq488V0rTFPdubDlCdUOinN2RQ83zyoT+q9xAIb+ q29PFu3AkKfOQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rvi-JR; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Bingbu Cao , Mauro Carvalho Chehab , Shawn Tu , Tianshu Qiu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Jonathan Cameron Subject: [PATCH v5 18/30] media: i2c: ov2740: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:14 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov2740.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index 0f3f17f3c426..54779f720f9d 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -751,9 +751,8 @@ static int ov2740_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&ov2740->mutex); if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&ov2740->mutex); return ret; } @@ -1049,9 +1048,8 @@ static int ov2740_nvmem_read(void *priv, unsigned int off, void *val, goto exit; } - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { - pm_runtime_put_noidle(dev); goto exit; } From patchwork Thu May 6 15:23:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33E83C43470 for ; Thu, 6 May 2021 15:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CA4F61289 for ; Thu, 6 May 2021 15:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235320AbhEFPYz (ORCPT ); Thu, 6 May 2021 11:24:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:38228 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235205AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 771F7613F1; 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=5KztMjooOddzA79l4hTCyOZrgNAAq7qVnwZ9IgWgZxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AO1K+ztJy0oV30u1iC4G7m4X8l+MgPWqY2fFg9YCKesRQgzoTTol8SMCbMhZfsURh AWfTXx7dLckj+KX647RhVkO3YeWNaek1NYfTVhLG53FiSuuKgZCmIHKHQZ0PdIcgud cBiJf45DCpFYjkG49aKiZv3UiMEjaNmYXUvrlbkFbqiKdxpnyl4tjLi0Y5xyZXwDGT Z9jyd6+CbHDlvVzCwUD6PD9igTy+ECIKoipy1APajZ5CYUCzDelC/aYvmGOFPcUymb Vxjwhjf5MG0nLaAs5Z8J+ksWgrpSD/uaX7yre16wtldola1rwVYSsqPfw/ymzSJmHf kS6q0MPiixGCQ== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rvm-Kq; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dave Stevenson , Jacopo Mondi , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 19/30] media: i2c: ov5647: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:15 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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. Acked-by: Jacopo Mondi Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov5647.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c index 1cefa15729ce..38faa74755e3 100644 --- a/drivers/media/i2c/ov5647.c +++ b/drivers/media/i2c/ov5647.c @@ -882,20 +882,20 @@ static int ov5647_s_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) goto error_unlock; ret = ov5647_stream_on(sd); if (ret < 0) { dev_err(&client->dev, "stream start failed: %d\n", ret); - goto error_unlock; + goto error_pm; } } else { ret = ov5647_stream_off(sd); if (ret < 0) { dev_err(&client->dev, "stream stop failed: %d\n", ret); - goto error_unlock; + goto error_pm; } pm_runtime_put(&client->dev); } @@ -905,8 +905,9 @@ static int ov5647_s_stream(struct v4l2_subdev *sd, int enable) return 0; +error_pm: + pm_runtime_put(&client->dev); error_unlock: - pm_runtime_put(&client->dev); mutex_unlock(&sensor->lock); return ret; From patchwork Thu May 6 15:23:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EF14C4360C for ; Thu, 6 May 2021 15:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C0B361177 for ; Thu, 6 May 2021 15:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235348AbhEFPY6 (ORCPT ); Thu, 6 May 2021 11:24:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235209AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B1B0613FE; 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=30FDfGkSRFbi6myOhgI3rDKaVJ2tBblGkl0/ENBmv/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oudc2NJojYJrxlB7Sngd/MB/YPMuCV/Wy71jhID2TrHJ1LEQLfURAvUj4+mueNWfs u+xfHi5b4NcbgtX4+fzej9gq88Mtkp7mA/O85EybNkVMLZ1Sl7ie1/3vO3E9pnpuWo mMXo+QBjAEjHiAWxBP2jPTMqVOhm0oI84Brkhd8DS21VQ3bnOC5OugEJStjVdpJu04 0k8xAX0yb4dZ2wCk5n0QfHzjXfoSAD2ahmLrj4OFP9qSWZ+qe674cf7P+2W7eiMga5 qxU43b62ON5CpZpBQwpPmL5xTjdGPj3TDE/JxKKiWiLrn2JEHxxiWDQ3ObolRvfuIQ 5BxivW18Q0ZAw== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rvq-MO; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Colin Ian King , Dan Carpenter , Ezequiel Garcia , Mauro Carvalho Chehab , Paul Kocialkowski , Sakari Ailus , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 20/30] media: i2c: ov5648: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:16 +0200 Message-Id: <503e30ad17f1c5b72ee5413d13ce31e4de4c705a.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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); From patchwork Thu May 6 15:23:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB0DFC433B4 for ; Thu, 6 May 2021 15:24:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83431611AE for ; Thu, 6 May 2021 15:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235141AbhEFPZA (ORCPT ); Thu, 6 May 2021 11:25:00 -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 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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) From patchwork Thu May 6 15:23:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B4E0C433B4 for ; Thu, 6 May 2021 15:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E367613B5 for ; Thu, 6 May 2021 15:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235342AbhEFPY5 (ORCPT ); Thu, 6 May 2021 11:24:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235212AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 985F061404; 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=kwIJFx+3BZT7CutnecuzIxhgs2GnXNtjRI6MBhWOcG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a+tPDbyenogZ7UBlgx+BT4D5sZ3GwxnDHLgMxA0O3QebeWgYQBkmOBwFHk66pYQVB Uzmmmjm9QQeOICXgFQBYMaW5Z/iA1Afg1C1OE3eRAoqe/dvOzCZyBe9QzLUvGH2qF0 d1eFzfSWns2GvQ87PrERAX1EBP80AIGABrNJt+TNDLsm4KneUFLBsa0ULmtaYSP+uj GwwVEczja/IDxOJxE9+qoCKXoqyuzykfOebTrKrNLMWiayg5iwBCEkhzX/rBaWY0qg GIh4/6z6d1o+YdS9h3RmMh6s+bcidKo3kbIVz34GsbhkhCbll7Z4MVy1FiJrkCSAHx MVyZQXwm6miJA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rvy-P9; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Shawn Tu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 22/30] media: i2c: ov5675: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:18 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov5675.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c index dea32859459a..e7e297a23960 100644 --- a/drivers/media/i2c/ov5675.c +++ b/drivers/media/i2c/ov5675.c @@ -863,9 +863,8 @@ static int ov5675_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&ov5675->mutex); if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&ov5675->mutex); return ret; } From patchwork Thu May 6 15:23:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31EE1C433B4 for ; Thu, 6 May 2021 15:24:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 05006611AE for ; Thu, 6 May 2021 15:24:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235381AbhEFPZG (ORCPT ); Thu, 6 May 2021 11:25:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235218AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A99A561410; 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=9V28x/0yZtyv8nyV8uH7fSioPt4mARji1tVhL7JUs2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFZ8hIqArABpk9DMDsf/G1CDPC2hBXzDlWqScqzaDy2PmCW216C90N7mKmCcTosVk v/LYTGIJGoMmGHIzjDDBTlzA9cZt5SP3ifKnrsL3Mm1kj+zcbcxM5ZR0Z3Lw84yzJi wBastm0hfg/0iBXMFQRlz3zpMlCY/iDTttmyAJ2jbYawuKXcW599mOhgoCel/hBWW+ D/94K/HajOndVnUanH6cRqGJBINikcG9zT0xB3lQBPoCBbiVh9ZmHkqwGVy8icz74P L9FKMB6A775S/fk7Rb6juADRSlx5laMFyiDq9UB1eugayIOT1C4PlhAH+pTqNwSint UU7druy0MzLzg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rw2-QQ; Thu, 06 May 2021 17:23:28 +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 v5 23/30] media: i2c: ov5695: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:19 +0200 Message-Id: <2dec6444d6c68c1acd81b5d5cd4bb6a437104959.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov5695.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5695.c b/drivers/media/i2c/ov5695.c index 09bee57a241d..469d941813c6 100644 --- a/drivers/media/i2c/ov5695.c +++ b/drivers/media/i2c/ov5695.c @@ -946,11 +946,9 @@ static int ov5695_s_stream(struct v4l2_subdev *sd, int on) goto unlock_and_return; if (on) { - 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 = __ov5695_start_stream(ov5695); if (ret) { From patchwork Thu May 6 15:23:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9304DC433B4 for ; Thu, 6 May 2021 15:24:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B55861289 for ; Thu, 6 May 2021 15:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235367AbhEFPZD (ORCPT ); Thu, 6 May 2021 11:25:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:38282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235216AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C4E386141C; 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=1hLBMVYTJOCW5MEqPMZGaS4TnBgfP7FzLvbrbNFMiSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udizQGD4ai/tQ1BxOZoR4X528UYy3XN8y2udgEPvmvwLkJT13xQ/KNKJL7JTOlZbW Axy0mZR3LkF+9s+jNqGPQSq+0HNi2DxShqHkO/478ISY/tL3W3NGJJzebh2NcPohm5 v8GdlcwEJQhNIaA0NVMCXJ/PtGxUP/tvSkMygcMw+BPXGGABbJyhum/7WHOHgkmyE3 zxewJsbVWpsw2DZymJnb3latgaHCKDiGwjAaT3Jjs90zMkSH39YFKW1mlVuhoU/oMt dc6uc0jqwwUX9dTGR29GZJRD1TLszjuycOO0GwPbrFib5m7MonwMWIqk62Y1VKGRGQ 2/VdZf9lYEZEw== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000Rw6-Rh; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Wenyou Yang , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 24/30] media: i2c: ov7740: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:20 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov7740.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 47a9003d29d6..e0ff6506a543 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -624,11 +624,9 @@ static int ov7740_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; - } ret = ov7740_start_streaming(ov7740); if (ret) From patchwork Thu May 6 15:23:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D13DC43460 for ; Thu, 6 May 2021 15:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 673E2610A5 for ; Thu, 6 May 2021 15:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235358AbhEFPZB (ORCPT ); Thu, 6 May 2021 11:25:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:38130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235215AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD60961419; 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=Z0USvyTZ3fXu9UhxRT5FD354jvvwjeNjqwFRY+Zs3l8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOZyHqll4X1/vDVakeOj+M9UTCwsPf9Mcd4AAHefLVWrTtKW5ZFiCj6s2MknjFQZf s52/lV4CJ+Ndjdbe+7YTL4parQCosygYiEZ5K5/uPIjf9n910ssp12PnhMej9GWyh1 rBHdQrwraElqX9sCsscRqd9umpXtfOdixuBpAqJn/RD9YugsUG8fQd6CYng3i4zWvd 8di9+O4lyxwhV1XDU6t1k1jHVv1ro0MQjZRy7KWcF5BrR1nwExn89RttOhPvls3Ksw oZ6XzB56fDZoaAESuaqbzf8Hauhx8qOvtxh7AhK98H0N9Y7sZ4ZI9Y2BtNRmKHlbkh D3dtk/NbBOUVA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RwA-Sx; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Dongchun Zhu , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 25/30] media: i2c: ov8856: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:21 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov8856.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index e3af3ea277af..2875f8e4ddcb 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -1340,9 +1340,8 @@ static int ov8856_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&ov8856->mutex); if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&ov8856->mutex); return ret; } From patchwork Thu May 6 15:23:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3262EC433B4 for ; Thu, 6 May 2021 15:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2FC1610A5 for ; Thu, 6 May 2021 15:24:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235376AbhEFPZE (ORCPT ); Thu, 6 May 2021 11:25:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:38112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235213AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C09AC6141A; 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=oAi5YzlfFlQMfzPh3wYGQ2xjGcqBCgu57W3dE0PjRzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mFSysAG6gGF4Ca7mSULlQfoJJoiQNc8fRsRRyAoaUjEieiW4nM4jU/nVURp5SeGkY hA3irzWqx/bHvscGSu3yWWS6Sr03eOSUNa+ORpVODqbioRVKwxxCCNKhUHdliRIpSN 0dOhBf8Uvi6j8z6J0sGpyQT5JmKG8SvxPXK8cKTnuX8VX4Bp5osXawVopX/WYo/8SB +VmrDlgOscNbE8JmAzNCV1eEnrxNZSA238+3DcPQ8kPyUp6HgZPsYygZaq5kBTvZGF cM57lLh0s3T+3TjBJgbwXHre0b/T1NmqlSwAabgF5ohja66SVDvIzhhT0iuX7qe87d JRAJQzJkjKp8A== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RwE-UI; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Ezequiel Garcia , Hans Verkuil , Mauro Carvalho Chehab , Paul Kocialkowski , Sakari Ailus , Yang Li , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 26/30] media: i2c: ov8865: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:22 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov8865.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c index 9ecf180635ee..3bf6ee4898a9 100644 --- a/drivers/media/i2c/ov8865.c +++ b/drivers/media/i2c/ov8865.c @@ -2497,11 +2497,9 @@ static int ov8865_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); From patchwork Thu May 6 15:23:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D680C433B4 for ; Thu, 6 May 2021 15:24:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5486361177 for ; Thu, 6 May 2021 15:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235403AbhEFPZJ (ORCPT ); Thu, 6 May 2021 11:25:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:38284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235220AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C825161420; 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=CBbCf8lLczURo0R8ANC6iiJbxWCN1ESFz/X/hIdzJFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tM6sZjc5RJxm0mp26SPFpDPSPjt6ZbHxMpP0tPwai82cU1K8qiW06KP15jv7cIa5M lKMBMy2VRta23dDV70fLloiccd10oIrZDdir8rnd2wp+i1sA+vBoOX0s3BKT0YotTA rZtbRKpL504g1mL3FEgGjHUDOdNpLlwGLwQ3fUwaLFnTZxG/79kgNyWu6bJvqnDWt7 a/YX4vkUrg+cyIiQL3fnonOofz54K7XV40RsIImwymJtxNGahZ3kVMMnrhAb2PjH7T TzLf+0f72Tsu9Fs5eAQoCBCOHXfZNUME2+Wu32EjT9/gTunjMbOTqxFY1ZQb43jbtb rM0jssLBj+TWg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqa-000RwI-Vb; Thu, 06 May 2021 17:23:28 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Bingbu Cao , Mauro Carvalho Chehab , Tianshu Qiu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 27/30] media: i2c: ov9734: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:23 +0200 Message-Id: <0c93fb2b811c00a58142b49fd2c21c7e0fb4c69c.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/ov9734.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov9734.c b/drivers/media/i2c/ov9734.c index b7309a551cae..ba156683c533 100644 --- a/drivers/media/i2c/ov9734.c +++ b/drivers/media/i2c/ov9734.c @@ -644,9 +644,8 @@ static int ov9734_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&ov9734->mutex); return ret; } From patchwork Thu May 6 15:23:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 326B4C433ED for ; Thu, 6 May 2021 15:24:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AF5E613C7 for ; Thu, 6 May 2021 15:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235412AbhEFPZM (ORCPT ); Thu, 6 May 2021 11:25:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:38280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235219AbhEFPYd (ORCPT ); Thu, 6 May 2021 11:24:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D232361423; 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=nHZL/8LfEY59F+jSTZXbI5IsJhAvjS0xN6pbKcv/Zf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vCnzn3EefAS6OJ0ojXlBof9/Um+5ehG6wridu2MaMlanV/rl/YYLLNH0U5ilUDkwN f+ETGwD2Eyyj3YN5amOJb4V+MJEgRiMJPuKa5wOplwc10wWd9dMTHqJWvWcGUyqQtP +zxm+41R3ukVSAAuoY/kYwMOtyGzJBhx8UjM04KXXZ1uB7gp6bc3T6nbCg3z0cV/GP LHI2BxYqoNLU+XJ8P5AH8fSzj08J2jYm2Y1mGUIvYyBkkdFtBAriqHROVJhsIAKPJU vCwABEEhqBdHQptJrG+u0PRT/dDvr7QkWYoE73VIPJ9x7x9as2fwPFCyLoi7tF1gFT q8aU1KzCSgpzg== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqb-000RwM-0k; Thu, 06 May 2021 17:23:29 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , "Gustavo A. R. Silva" , Chuhong Yuan , Hans Verkuil , Jacopo Mondi , Krzysztof Kozlowski , Marco Felsch , Mauro Carvalho Chehab , Sakari Ailus , Zhang Xiaoxu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 28/30] media: i2c: tvp5150: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:24 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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/tvp5150.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c index e26e3f544054..374a9da75e4d 100644 --- a/drivers/media/i2c/tvp5150.c +++ b/drivers/media/i2c/tvp5150.c @@ -1448,11 +1448,9 @@ static int tvp5150_s_stream(struct v4l2_subdev *sd, int enable) TVP5150_MISC_CTL_CLOCK_OE; if (enable) { - ret = pm_runtime_get_sync(sd->dev); - if (ret < 0) { - pm_runtime_put_noidle(sd->dev); + ret = pm_runtime_resume_and_get(sd->dev); + if (ret < 0) return ret; - } tvp5150_enable(sd); @@ -1675,15 +1673,7 @@ static int tvp5150_registered(struct v4l2_subdev *sd) static int tvp5150_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int ret; - - ret = pm_runtime_get_sync(sd->dev); - if (ret < 0) { - pm_runtime_put_noidle(sd->dev); - return ret; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int tvp5150_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) From patchwork Thu May 6 15:23:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E2B4C433B4 for ; Thu, 6 May 2021 15:24:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22A2D61177 for ; Thu, 6 May 2021 15:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbhEFPZP (ORCPT ); Thu, 6 May 2021 11:25:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235161AbhEFPYj (ORCPT ); Thu, 6 May 2021 11:24:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF6D061426; 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=HyEc9UNwq5f+9HkjZrtYJol03xr9+57BThXZkb1RvbU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zr4XORA0UIja5TGWNYfypJu8ac+wIlsz1ZhleHAIroEDx25+SY/hySKaAXyHTmZrb WtRJnUl/j69SsgG2gq4qfTHSqarIUzUcvDAHZzXl5lF1THl6QWDl1Pa4puxr9N4eRf fNZ2nJCK53Ja6eNsWR/D17im9ZFDxso4BmVaywlWRdeN5xVe0a40wIazu4ROm57NuS ynMRM2oLufrzMQhgmZaEZcUjF+HEop/veNcCZnv2mo4vP7w/e8mcehkFPBy1yUwXpB 2NjaHfMjfeem03LOthYrlIt4MXBdC7iILpt7zachvADpQsmOfLsuEiXNXPNvw2YZRU fd1QOpY6efmJA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqb-000RwQ-28; Thu, 06 May 2021 17:23:29 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Matt Ranostay , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v5 29/30] media: i2c: video-i2c: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:25 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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 Acked-by: Matt Ranostay --- drivers/media/i2c/video-i2c.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 0465832a4090..de12f38f347c 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -286,11 +286,9 @@ static int amg88xx_read(struct device *dev, enum hwmon_sensor_types type, __le16 buf; int tmp; - tmp = pm_runtime_get_sync(regmap_get_device(data->regmap)); - if (tmp < 0) { - pm_runtime_put_noidle(regmap_get_device(data->regmap)); + tmp = pm_runtime_resume_and_get(regmap_get_device(data->regmap)); + if (tmp < 0) return tmp; - } tmp = regmap_bulk_read(data->regmap, AMG88XX_REG_TTHL, &buf, 2); pm_runtime_mark_last_busy(regmap_get_device(data->regmap)); @@ -512,11 +510,9 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) if (data->kthread_vid_cap) return 0; - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_noidle(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) goto error_del_list; - } ret = data->chip->setup(data); if (ret) From patchwork Thu May 6 15:23:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12242367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA087C43461 for ; Thu, 6 May 2021 15:24:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D175D6121F for ; Thu, 6 May 2021 15:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235413AbhEFPZP (ORCPT ); Thu, 6 May 2021 11:25:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235226AbhEFPYj (ORCPT ); Thu, 6 May 2021 11:24:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF8BD61414; 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=1620314611; bh=79OkehonmjtZng1/b9LdwRP7XaO8omnxvo99Fl7zk0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e9Sjz/0Ldr9Vqmcgo7hHeTt48TKpX2hJHRAGXrChAnj4HQK04a+O8wMEDAyPnzBj5 83t+NUzy+Msm5WQWVoSMqlhLN1yWxf2yZsITvPExdDZcxEMe1Aax0WhoYevh846Awh W/rGEsqo+aW+xbOadaWiekD0TTmp9h1xYYa1a0/CIU8muCMvTEqXc353Priz8fLB18 BgB1hSTVefTGinDBtzFb2JB5cazZOZTfcfjM59b8uQ8rbybwbq9zNEGpi+mG/MWyVL QZkdRXQ+UBo8i218IXTtPRYkbVeoLRd0YWYxw+xQGeYPDOREwMsAOymalXfQt+hD7g fDIlnXCI2jQAA== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1lefqb-000RwU-3b; Thu, 06 May 2021 17:23:29 +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, Jonathan Cameron Subject: [PATCH v5 30/30] media: i2c: ccs-core: use pm_runtime_resume_and_get() Date: Thu, 6 May 2021 17:23:26 +0200 Message-Id: <588552504c2e4b0347b237454588e7040eff857a.1620314098.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@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. Reviewed-by: Jonathan Cameron Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ccs/ccs-core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 4a848ac2d2cd..a349189a38db 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -3101,12 +3101,9 @@ static int __maybe_unused ccs_suspend(struct device *dev) bool streaming = sensor->streaming; int rval; - rval = pm_runtime_get_sync(dev); - if (rval < 0) { - pm_runtime_put_noidle(dev); - + rval = pm_runtime_resume_and_get(dev); + if (rval < 0) return rval; - } if (sensor->streaming) ccs_stop_streaming(sensor);