Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1029390imm; Mon, 9 Jul 2018 15:42:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfxoFZNVLb90jQLnwdDDcUZO6Dl5QXaXHogzPqcKplpuwq9AzaCQ46VXYMTCIQAcYvhpaxh X-Received: by 2002:a17:902:788e:: with SMTP id q14-v6mr21952518pll.234.1531176164843; Mon, 09 Jul 2018 15:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531176164; cv=none; d=google.com; s=arc-20160816; b=uu2vQDyQM9kY9asyJ8+2YgA8PBKv4ZstxM2VvgZiX22wkqNHHxWr1qS4lLylAQjskZ +hdk8jxgOxhbHL2umRCddd98AwLjXFFJmDhKvWcpJe4vB3ts9xbveWCP4XfOIiHw+l4T ctkPUayvgS+1OpWh7lN39uBOBrXsQsBjFJutHA9Z+d6axvijf9+9dp544k9uW4tkV2Dc vDpuaHP3Pq0oKPgdo1cppGrKBsqp/enYOK1m4vIiZqhy4sIBkVTW2Erw7f9OeiDvHxSi +jEiUZpUkYTwqATJKh7BXGYbsH9R7EdGHlcBeQ2cuzMJAQXORXgFdrSkk+5+geLw8KCX O9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=DgmGdYmryCeQfiqt5Qy1bS1F3s2iiSYKxPQ+fmoNc/I=; b=PaP+2JWQ+y+Vz0wYyBKGovII8Bd1vNssp1I5ys6PBQW2p/72F26hhGCvHD2gsoKAXH AnasqbSbxjDy0AYNFpeVTCZwwfdc4URlBaEIMBwmXAu1VwxOpAhsgG5VhF2fmNDBrixC T0/Axhrq8juJouUU+p5WG6qWIB87nsaQ9X4azG8RKMUl6hmOX8TARk2CJvTPUfCEZjis 06dnodIg59Plrcb6EFtvqTxaVcAMXStcQlUpQy4vGAc/NmHMI2KR/HjHoKVV8IMrZH8F BOnu5mpAbkVgtR1qewiUDN7DzP4w+uqIIRQoNKkyORHyHVv6BK6mJj1jyBI7O8WVlK44 AiUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DdBZr2pI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r69-v6si16280830pfl.260.2018.07.09.15.42.30; Mon, 09 Jul 2018 15:42:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DdBZr2pI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933460AbeGIWkB (ORCPT + 99 others); Mon, 9 Jul 2018 18:40:01 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35423 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933438AbeGIWj5 (ORCPT ); Mon, 9 Jul 2018 18:39:57 -0400 Received: by mail-pg1-f193.google.com with SMTP id e6-v6so1550302pgv.2; Mon, 09 Jul 2018 15:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DgmGdYmryCeQfiqt5Qy1bS1F3s2iiSYKxPQ+fmoNc/I=; b=DdBZr2pIhQluQ3uCBUPXIuadeeUXedJk0hwMB+l6cZED9S+ueOP9YFxNqShVaXLuzl aYb8DznPP++rjosYBNPpyhc92t494FH2P32rAwPoYpVvtW0Ab8jDBNAh4HFfQmhzoYTG caaT1WxUfw027GxeUqRmPQvRNImWfH5c8mGke9uIRTw7Rmkrs66aTdAGR6g+j4xL71CM WWUCi9s4a957fW/ujlA7Bhh40TxMIxz1vonoJMTbGbXco3GadkqbZ6fkF+bS9rFA+JVY UsULvGaDJf48z2C/xHjg7ZQirpaeGOQd47tMXZwqKGMyTn40uMHVonAybcT1F+wKVWbq X0nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DgmGdYmryCeQfiqt5Qy1bS1F3s2iiSYKxPQ+fmoNc/I=; b=JY+wehfOMFzhskVsVQ+uIK2LqXEYqdBuwu2+yvChu4J+sTUxAbukLQqhw6ia3z6dkw Q2xdlvpomfTBqr0bogsMj6n2jqFSSrNchnUJxzPIR7/ijuajWCgY5gSqE6SMiOgJa0q3 /0rvIRLjZue90l04I/bHIHmheC0Es15HZQsO8q9yHNFn69WLrcVDSJ1OKqBEp6C/bjj1 UG4jsDMqfYPiL/zDiQOokqwA4D+CTZKKX4EATAoNijv6eFrizkgpRui5RVRobshBC9iB UmatYkNMMKgv29zMNjKYBufPr70X+DPA0TpknNzjKB/Q+kwtB9XkKYalLerP3BLXdvCr Lb7Q== X-Gm-Message-State: APt69E0lW9ZranlTT31eeoho2d1YlZEPQGyvRKtmS2DylHZl4he6QoDx 5YDqSwaHBxM3xwNa4MMqAcL1Zg== X-Received: by 2002:a65:6689:: with SMTP id b9-v6mr20241561pgw.326.1531175996831; Mon, 09 Jul 2018 15:39:56 -0700 (PDT) Received: from majic.sklembedded.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.googlemail.com with ESMTPSA id r16-v6sm30143804pfe.173.2018.07.09.15.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jul 2018 15:39:56 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v6 11/17] media: staging/imx: Loop through all registered subdevs for media links Date: Mon, 9 Jul 2018 15:39:11 -0700 Message-Id: <1531175957-1973-12-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531175957-1973-1-git-send-email-steve_longerbeam@mentor.com> References: <1531175957-1973-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The root imx-media notifier no longer sees all bound subdevices because some of them will be bound to subdev notifiers. So imx_media_create_links() now needs to loop through all subdevices registered with the v4l2-device, not just the ones in the root notifier's done list. This should be safe because imx_media_create_of_links() checks if a fwnode link already exists before creating. Signed-off-by: Steve Longerbeam --- drivers/staging/media/imx/imx-media-dev.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index b0be80f..ae87c81 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -175,7 +175,7 @@ static int imx_media_subdev_bound(struct v4l2_async_notifier *notifier, } /* - * create the media links for all subdevs that registered async. + * Create the media links for all subdevs that registered. * Called after all async subdevs have bound. */ static int imx_media_create_links(struct v4l2_async_notifier *notifier) @@ -184,14 +184,7 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier) struct v4l2_subdev *sd; int ret; - /* - * Only links are created between subdevices that are known - * to the async notifier. If there are other non-async subdevices, - * they were created internally by some subdevice (smiapp is one - * example). In those cases it is expected the subdevice is - * responsible for creating those internal links. - */ - list_for_each_entry(sd, ¬ifier->done, async_list) { + list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { switch (sd->grp_id) { case IMX_MEDIA_GRP_ID_VDIC: case IMX_MEDIA_GRP_ID_IC_PRP: @@ -211,7 +204,10 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier) imx_media_create_csi_of_links(imxmd, sd); break; default: - /* this is an external fwnode subdev */ + /* + * if this subdev has fwnode links, create media + * links for them. + */ imx_media_create_of_links(imxmd, sd); break; } -- 2.7.4