Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2826816pxv; Mon, 12 Jul 2021 02:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJM/dpVC4kJ9F3l2gPXxkPNkJlfuvxHeNNIpt6XEvE0lkZ4QAGGJpYXSRdRzngkvdvVErS X-Received: by 2002:a92:7c10:: with SMTP id x16mr15835320ilc.192.1626083722561; Mon, 12 Jul 2021 02:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626083722; cv=none; d=google.com; s=arc-20160816; b=zNYNHO4zc4Td/YjiqqPs1a/WQUq9KhuavW1dWuH3YYUJjsYx8F5mM5u3yqqNS67aQ/ g8bdVJCuwxhGz7MYgp6wLIkIzVAl7myJ5ZEQ8rjEYX20eFOFQj3Ja0tH94Jp/3v48zFy JQLZZJg3K5GuPHmAxgjpWh2+0g6F3Z4gJ2eKnUCDxjEep92N3RWR19H8USmZmBRc21F/ NIxho0R7E4KaxhEIWkkPhh5J3D8s7a2wZX0fqLVTpeRSe60FI3h3+SgD2WRUhYLnit49 onMCJXc4muDOP8M1pEBpVikGh9ujS6KvJKvDdU1qEnetVtpxSxwCNue+AGUw8hzjVLrr WIeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DJKzqftYgBsjtuOf0i9NZsbh9noA/P/G2nwQvzog9Dw=; b=x5yvGYiUSIldLihD12JVRLTZtQLugVGCm56f2njM92oIt/Uxfbm+XSsWfEE+g2X0YD 090imwTjGdHSA7UGjYRVEyYyJMYDBmziWfjjpnSio40qYj50hmv805Ab30pDqysdo9g+ JdIGuU/CcjE2npBGrait0s3XbIEG3AK+dJjRKbYtFFGCGKGheS3/qXEjWURhcAeiz1Se 7Dtiw7EONaToelpvG+OR7d1Ulb9/2Q0lN+HarYgY9nzIvDEbhwanrjqYduPzePKPkE5j IitNXoDDliBa5bAddov8A0a/NUCmmoYjGjrms59weYJ0J62Te4uipRc+3u1BLuqXbNol 0ktg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lmhcMzJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si4658694jal.120.2021.07.12.02.55.11; Mon, 12 Jul 2021 02:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lmhcMzJm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239186AbhGLG51 (ORCPT + 99 others); Mon, 12 Jul 2021 02:57:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238626AbhGLGlX (ORCPT ); Mon, 12 Jul 2021 02:41:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F3C636113A; Mon, 12 Jul 2021 06:38:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626071911; bh=zSotkfngwV/n6iBL2G1niE6abch1cGZL+Sg9+kATzwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lmhcMzJmGql3ustnNR/Kgs+cqnBw72MlOogLyNi/iL1pVBAUPBbGOFd38XPMOot8T 84e5zbzduJVF8c0+7HQKL1+Z4ciHErxRMQsSBMdtV4Yqjc/xLrzuGrJDMblgg37Y4I MexpZ2Xa0QlEU9IXkGm7L9pz/GZ5JOOxldHS6qBk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 273/593] media: video-mux: Skip dangling endpoints Date: Mon, 12 Jul 2021 08:07:13 +0200 Message-Id: <20210712060913.807733304@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060843.180606720@linuxfoundation.org> References: <20210712060843.180606720@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Philipp Zabel [ Upstream commit 95778c2d0979618e3349b1d2324ec282a5a6adbf ] i.MX6 device tree include files contain dangling endpoints for the board device tree writers' convenience. These are still included in many existing device trees. Treat dangling endpoints as non-existent to support them. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Fixes: 612b385efb1e ("media: video-mux: Create media links in bound notifier") Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/video-mux.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c index 7b280dfca727..640ce76fe0d9 100644 --- a/drivers/media/platform/video-mux.c +++ b/drivers/media/platform/video-mux.c @@ -362,7 +362,7 @@ static int video_mux_async_register(struct video_mux *vmux, for (i = 0; i < num_input_pads; i++) { struct v4l2_async_subdev *asd; - struct fwnode_handle *ep; + struct fwnode_handle *ep, *remote_ep; ep = fwnode_graph_get_endpoint_by_id( dev_fwnode(vmux->subdev.dev), i, 0, @@ -370,6 +370,14 @@ static int video_mux_async_register(struct video_mux *vmux, if (!ep) continue; + /* Skip dangling endpoints for backwards compatibility */ + remote_ep = fwnode_graph_get_remote_endpoint(ep); + if (!remote_ep) { + fwnode_handle_put(ep); + continue; + } + fwnode_handle_put(remote_ep); + asd = v4l2_async_notifier_add_fwnode_remote_subdev( &vmux->notifier, ep, sizeof(*asd)); -- 2.30.2