From patchwork Sun Jan 29 02:34:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 648433 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 455CFC61D97 for ; Sun, 29 Jan 2023 02:34:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233790AbjA2Ceo (ORCPT ); Sat, 28 Jan 2023 21:34:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232304AbjA2Cem (ORCPT ); Sat, 28 Jan 2023 21:34:42 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6204B234CB for ; Sat, 28 Jan 2023 18:34:41 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CA7B5FE8; Sun, 29 Jan 2023 03:34:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1674959680; bh=qL66w5AqxMtao7vMYKI6UlzBd8I4OnL2OnUA7hbWbC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6Tb4BwYK0tAiAma4XfCNyVO9zHI9Oke6nHNfsKmpkX7HW/h5ubTvvxKzbZOhjS8V F2JXxnSxqumGwRMta8vut9vQ5bnox4aT3UbSsLBg7HKLXOoGoKSt9jq+35sp9NZxlx 2KqcrR/hVR4aOBuNSIT1d65fdIg92sJEZBP9Dk0c= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Adam Ford , Martin Kepplinger , Paul Elder , Rui Miguel Silva , kernel@pengutronix.de, linux-imx@nxp.com Subject: [PATCH v2 4/8] media: imx: imx7-media-csi: Drop unneeded src_sd check Date: Sun, 29 Jan 2023 04:34:25 +0200 Message-Id: <20230129023429.22467-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230129023429.22467-1-laurent.pinchart@ideasonboard.com> References: <20230129023429.22467-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The .s_stream() and .link_validate() operations can't be called with a NULL src_sd, as subdev nodes are not registered before the async notifier completes. Remove the unneeded checks. Signed-off-by: Laurent Pinchart --- drivers/media/platform/nxp/imx7-media-csi.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index 45b29d312276..62232cd6775f 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1731,11 +1731,6 @@ static int imx7_csi_s_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&csi->lock); - if (!csi->src_sd) { - ret = -EPIPE; - goto out_unlock; - } - if (enable) { ret = imx7_csi_init(csi); if (ret < 0) @@ -2026,9 +2021,6 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd, unsigned int i; int ret; - if (!csi->src_sd) - return -EPIPE; - /* * Validate the source link, and record whether the source uses the * parallel input or the CSI-2 receiver.