From mboxrd@z Thu Jan 1 00:00:00 1970 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 42E90C0015E for ; Tue, 1 Aug 2023 14:19:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234594AbjHAOTs (ORCPT ); Tue, 1 Aug 2023 10:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234571AbjHAOTn (ORCPT ); Tue, 1 Aug 2023 10:19:43 -0400 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 48718BF; Tue, 1 Aug 2023 07:19:42 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F26E23D4; Tue, 1 Aug 2023 16:18:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690899518; bh=yYCzuAsWFgam1CbLcV7JEpnOccTdDChFY+iYxr59JXg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nFLbk5tUzdLTp7ATmScpwTyXnsMEHngKzELiC/B9BCVzHd3tuMLsiZcs+gCaDFe0h YdC0h4uwUczXXq1Qk+Fcib1+MX1idKdLlbFREuhxApiZkbsaONjcJ3dcG/JiKNOen7 N0nAUPTHPvkEYDb0V1K88US2f/QLhFD9g+y0KXIs= Message-ID: <66bb2250-4834-13e8-30cf-7ca651799b43@ideasonboard.com> Date: Tue, 1 Aug 2023 17:19:36 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v8 13/16] media: cadence: csi2rx: Add link validation Content-Language: en-US To: Jai Luthra , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , Maxime Ripard , niklas.soderlund+renesas@ragnatech.se, Benoit Parrot , Vaishnav Achath , Vignesh Raghavendra , nm@ti.com, devarsht@ti.com References: <20230731-upstream_csi-v8-0-fb7d3661c2c9@ti.com> <20230731-upstream_csi-v8-13-fb7d3661c2c9@ti.com> From: Tomi Valkeinen In-Reply-To: <20230731-upstream_csi-v8-13-fb7d3661c2c9@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/07/2023 11:29, Jai Luthra wrote: > From: Pratyush Yadav > > Add media link validation to make sure incorrectly configured pipelines > are caught. > > Signed-off-by: Pratyush Yadav > Signed-off-by: Jai Luthra > Reviewed-by: Laurent Pinchart > --- > v7->v8: No change > > drivers/media/platform/cadence/cdns-csi2rx.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > index d82a8938932f..aec33d28a66f 100644 > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > @@ -463,6 +463,10 @@ static const struct v4l2_subdev_ops csi2rx_subdev_ops = { > .pad = &csi2rx_pad_ops, > }; > > +static const struct media_entity_operations csi2rx_media_ops = { > + .link_validate = v4l2_subdev_link_validate, > +}; > + > static int csi2rx_async_bound(struct v4l2_async_notifier *notifier, > struct v4l2_subdev *s_subdev, > struct v4l2_async_connection *asd) > @@ -679,6 +683,7 @@ static int csi2rx_probe(struct platform_device *pdev) > for (i = CSI2RX_PAD_SOURCE_STREAM0; i < CSI2RX_PAD_MAX; i++) > csi2rx->pads[i].flags = MEDIA_PAD_FL_SOURCE; > csi2rx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + csi2rx->subdev.entity.ops = &csi2rx_media_ops; > > ret = media_entity_pads_init(&csi2rx->subdev.entity, CSI2RX_PAD_MAX, > csi2rx->pads); > Reviewed-by: Tomi Valkeinen Tomi