From patchwork Fri Jan 28 13:36:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 12728594 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48383C433EF for ; Fri, 28 Jan 2022 13:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=2Ma81j+KSbInOUxGP5rgWxmSwz3TqgrkVK9skWdYb1o=; b=thpyhWFeZvZNq1 FB3wl2Ga5IkpB0untmQEIYA4AfNrXPBqTJnk/BhscA2rmZ7KMMyCAYW3Eqfb8WEzokk4AZd1q3rPm LpfbyV1+P3x7n6rcgPMZaBSLWnNDiLiqZKDJWzaRqMIZLHRaUTIN4lthDmcISf286A2oboOPJ+ctU KjjGoarurZK9NN2O6B3pEIRRzxv7nG0VvYciB7RLHXzsskl5Dtkxe4pJ6/VKpmml02no3b8HoAv6e uVQxw5nled0PJqBDoj49SEfwuwiCvwB79soZKXrqHXrjhq/x7M+ovgMN8mNdLyyafiektcszf49LA LJx7dO/bkH/8d/5aOjGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDRWL-002P78-Qo; Fri, 28 Jan 2022 13:42:34 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDRSG-002NSe-Lq for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 13:38:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: usama.anjum) with ESMTPSA id 6B9981F459D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1643377099; bh=tjEk8d0FDgHsxlcZ3Ake1MkPBeCUhxnRcVA14+aoN30=; h=From:To:Cc:Subject:Date:From; b=d9lQkqYsjK6BwmwbxdMHe3LfiS7qUPiwGC6pD2+LSsYvTtEWivRtbDbBCcCfYqYvL kqjHwe7IuAtqzqf9QbP2T8naH351qtq6RBM8vWCvRyuByo4EzC3vZEiFS81xKpUYpU RnaTewMPNjKPKEFQhKiFnv+50oz3FMefbFtEt0yEJFd2X2o1B+ADjOjJf/vdyDOLby t19SBvaHO2dMeSwkPyrxRCnD4ruZDvAoBPKB4BCzd9HfszerxidPbkqUjmeb5JNDfo ZFOApVnJcpOetTB4bIgMTn0+5rGM+kWc2MR0jm2+emn0K705vwG9svpzfU78263kJx 0D0G+BgWCIIrQ== From: Muhammad Usama Anjum To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Martin Kepplinger , Hans Verkuil Cc: Muhammad Usama Anjum , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: imx: imx8mq-mipi_csi2: Remove unneeded code Date: Fri, 28 Jan 2022 18:36:49 +0500 Message-Id: <20220128133649.1393201-1-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220128_053820_956593_819A6B96 X-CRM114-Status: GOOD ( 10.49 ) 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 ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot return error. Remove the return variable. Simplify other functions which are using this function. Fixes: f0c2ba1ed4ad ("media: imx: imx8mq-mipi_csi2: fix system resume") Signed-off-by: Muhammad Usama Anjum --- drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c index 3b9fa75efac6b..c992b845e63d1 100644 --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c @@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state) * Suspend/resume */ -static int imx8mq_mipi_csi_pm_suspend(struct device *dev) +static void imx8mq_mipi_csi_pm_suspend(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); struct csi_state *state = mipi_sd_to_csi2_state(sd); - int ret = 0; mutex_lock(&state->lock); @@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev) } mutex_unlock(&state->lock); - - return ret ? -EAGAIN : 0; } static int imx8mq_mipi_csi_pm_resume(struct device *dev) @@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev) { struct v4l2_subdev *sd = dev_get_drvdata(dev); struct csi_state *state = mipi_sd_to_csi2_state(sd); - int ret; - ret = imx8mq_mipi_csi_pm_suspend(dev); - if (ret) - return ret; + imx8mq_mipi_csi_pm_suspend(dev); state->state |= ST_SUSPENDED; - return ret; + return 0; } static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev) @@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev) struct csi_state *state = mipi_sd_to_csi2_state(sd); int ret; - ret = imx8mq_mipi_csi_pm_suspend(dev); - if (ret) - return ret; + imx8mq_mipi_csi_pm_suspend(dev); ret = icc_set_bw(state->icc_path, 0, 0); if (ret)