From patchwork Mon Aug 26 12:41:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 103663 Received: from sy.mirrors.kernel.org ([147.75.48.161]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1siZ4N-0005O2-0I for patchwork@linuxtv.org; Mon, 26 Aug 2024 12:43:48 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 21B26B22E48 for ; Mon, 26 Aug 2024 12:43:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFB2E187FEA; Mon, 26 Aug 2024 12:41:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cc2JKB5K" X-Original-To: linux-media@vger.kernel.org Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A79C18755F; Mon, 26 Aug 2024 12:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676079; cv=none; b=ie7ib09QmfxWWk8BnzriaUEk2C3aZO2yG0YPdWkihDJPG3ICtHiwDXJgJOHF1DDS4qwRS1p/DM7SU5fceU4SkE5Cc3use7MT2a8ncqMisw5X1Xm0phao1xUql4VrxiZU18u+qTPGyienWCv/PldIOqzAgbVtbCEe5Wydn4ToOaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724676079; c=relaxed/simple; bh=scQkDIL05VQp5Mauo9cfSnC/NPA9wVIB97pdzpBE5UY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LPcwGO/uZrwE/uH4SbWCGy4pUxnq0nTeMSmhhOtS7XITVFDNVbEVztWAKzblkKCnp41KLCO+pBxA+DJ37r+rvH+Q9vv5WHPwhCC+Ehk4qIVexV5qeqs/mJqR1g7vZhXMkU9NziomUWU4HhjvHlKrsxO+//XJvpmc5+07RTGsAgw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=cc2JKB5K; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E8F349FF; Mon, 26 Aug 2024 14:40:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724676009; bh=scQkDIL05VQp5Mauo9cfSnC/NPA9wVIB97pdzpBE5UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cc2JKB5K3mjkVUZvlSi/gydBbFcICpqPcFF7RuaRUnil/8XUXaZqlAkBUIkG4hTFs 6Ze0+mf6ro02CJ/4RP40rgpnfFCdZTtWJqB6HGwe9kpeBk5KnZ2aRCSPjwp7u5AXE7 msIJDAQujLqRiRGr+lyWPXzLv7hSmpSgqnkxxaEo= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Chen-Yu Tsai , Eugen Hristev , Hans Verkuil , Jacopo Mondi , Kieran Bingham , Maxime Ripard , Sakari Ailus , Tomi Valkeinen , linux-renesas-soc@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [PATCH v3 3/7] media: sun4i_csi: Don't use v4l2_subdev_link_validate() for video device Date: Mon, 26 Aug 2024 15:41:02 +0300 Message-ID: <20240826124106.3823-4-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240826124106.3823-1-laurent.pinchart+renesas@ideasonboard.com> References: <20240826124106.3823-1-laurent.pinchart+renesas@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-LSpam-Score: -6.3 (------) X-LSpam-Report: No, score=-6.3 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,DMARC_MISSING=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no The v4l2_subdev_link_validate() function is a helper designed to validate links whose sink is a subdev. When called on a link whose sink is a video device, it only prints a warning and returns. Its usage in the sun4i_csi driver is wrong, leaving the link from the sub4i_csi subdev to the capture video device unvalidated. Planned improvements to the v4l2_subdev_link_validate() function will turn the warning into an error, breaking the sun4i_csi driver. As an interim measure, move the warning to the sun4i_csi driver in a custom validation handler, and drop the call to the helper. Signed-off-by: Laurent Pinchart Acked-by: Chen-Yu Tsai Reviewed-by: Tomi Valkeinen --- drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c index dbb26c7b2f8d..d07e980aba61 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c @@ -35,8 +35,15 @@ struct sun4i_csi_traits { bool has_isp; }; +static int sun4i_csi_video_link_validate(struct media_link *link) +{ + dev_warn_once(link->graph_obj.mdev->dev, + "Driver bug: link validation not implemented\n"); + return 0; +} + static const struct media_entity_operations sun4i_csi_video_entity_ops = { - .link_validate = v4l2_subdev_link_validate, + .link_validate = sun4i_csi_video_link_validate, }; static const struct media_entity_operations sun4i_csi_subdev_entity_ops = {