From patchwork Tue Apr 27 10:12:49 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: 12225995 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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 890B4C433ED for ; Tue, 27 Apr 2021 10:18:05 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BE36613C3 for ; Tue, 27 Apr 2021 10:18:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BE36613C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=k4ncuRLh+kMXFY+tI1Opkrni7XJobtbJI/MNTJezb64=; b=Oa0aaom6MNtYnAeFl9TfjM9PQ lU1eD/E9B0fRnfvby977cGw83k62PaZ9CCOHFDDi2yP3IJbs96TFouY3eEf+qyj2Xtno7YEqrusv6 eWcTuH/+X+3yshXUdswuIJQwV/OTM1Am7x6VVuubsZdJUoX6E0fxAWt/SZIcn7BAy7eJRf9dbBmfh lY0NFuaY+s1Nu5169TkLVMUg9ZVgK7xhnPjW11F0YP4hso1AyN1jbZCEQjUUObp1i+tS9ZXy6IA1C 9ulkJxiMOz7sweKwOrEe/q5iXcRlnQ9HwQJLH6Xw5q/5PrPLabCdLAUTfQ1Q7iK2GRUTgpdu25Zyd mvxV/irSA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbKkx-001Jdu-HW; Tue, 27 Apr 2021 10:15:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbKj9-001JBw-QY for linux-arm-kernel@desiato.infradead.org; Tue, 27 Apr 2021 10:13:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=mRlhHz+TXhBYOhgqqW4JThrnHdpvqrv4T1yGT3S16Vc=; b=gaSQuSZ0hfjtKd/aKnP/j87tfw QXISaryULzrwQwvh0XghGG7VHPyx9IFQzj8TpqHicOJFYZFdDDnS6KmOCgfJRGIrla5ISXB8Cj/98 icqhzw/x09YMCIsOdH4NsUeqTULtD4Ckw2bnqaA0QcRlTKHsGVCvnZ1ZCBOhsyqow1WrabUpaiStQ TvhH5HPsBVzeUQL/9T2kiyaIKLbCvYr4XJQy9olM1yj46rGl4IQHD51O/G/cK6HB+07KAdUwRk/8E Mfw968YSpguSZeBiMP0skPgLGM4F/DjzUJDkM8nUfir7Z15goDe1YSs7dn9+qwsEnqJ92wHQkLmp5 VFpe4x7w==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbKj5-00GbpW-Of for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 10:13:58 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6276C61404; Tue, 27 Apr 2021 10:13:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619518431; bh=WwdunTEPlspSuJNcgiz5VlTq6QqTmYyotSIBFOxVREY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RtG8MWksBzzoyJ8f1T9mM9i2iWpOVxFMvdgZaznoqwOeoaF1BGLfN6hdQkAjTBmXG gb2wIhkMmOHaazVy75eeYno7XXgjTuDTo4qPz5ka6axbr96x+nj53BWjICe1um51TZ Ab2SEYW4bxlYb/EMBtKfknyNbdcyMBUMtn5cwqNvF53cmJ5coNHnmf55kcZuBwLfMK mdDcHBUCnS+i68sJTKVTgsL5OowpThLKgObLrRLqqp+Cgl4+UL2N7VTRjneXXG7SGn lbHNJ4HV7xV5mgvyn2gVH0+z2vWQ74G6QvtkK+B9ULi1pNuLp56InWHUaMNVebMj97 HV5QK/JmPrKRw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lbKiz-000j5e-1q; Tue, 27 Apr 2021 12:13:49 +0200 From: Mauro Carvalho Chehab To: Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Fabio Estevam , Greg Kroah-Hartman , Mauro Carvalho Chehab , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Rui Miguel Silva , Sascha Hauer , Shawn Guo , Steve Longerbeam , devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 22/79] staging: media: imx7-mipi-csis: use pm_runtime_resume_and_get() Date: Tue, 27 Apr 2021 12:12:49 +0200 Message-Id: <9b52f8d9709e32ac129563f508beaec8ab321409.1619518193.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_031355_934562_E3169456 X-CRM114-Status: GOOD ( 11.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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: Rui Miguel Silva Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/imx7-mipi-csis.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 025fdc488bd6..1dc680d94a46 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -695,11 +695,10 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) mipi_csis_clear_counters(state); - ret = pm_runtime_get_sync(&state->pdev->dev); - if (ret < 0) { - pm_runtime_put_noidle(&state->pdev->dev); + ret = pm_runtime_resume_and_get(&state->pdev->dev); + if (ret < 0) return ret; - } + ret = v4l2_subdev_call(state->src_sd, core, s_power, 1); if (ret < 0 && ret != -ENOIOCTLCMD) goto done;