Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1234626imm; Fri, 29 Jun 2018 14:02:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfGA3YkF6/GDodrs9ylLwYHVAFuFfLaNAvMtjpt+Uc4lqpdQhx4Euewe0mJbdKb7TSQNqQX X-Received: by 2002:a17:902:724a:: with SMTP id c10-v6mr5849089pll.64.1530306146781; Fri, 29 Jun 2018 14:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530306146; cv=none; d=google.com; s=arc-20160816; b=RE8veRGnZonz4vQ5RhgB3SAhkL9Gd3SBGFjyfkS+u/YQ08ZYpaI0ep+8SDBx09OPSM egEJRxJ8hykBly/kX+DKgUgi0FjyTI80iUArb8rX1xoUE+JXp9XBjdupPv1BuNS2M7eF 8UYewEGfLQT9iYvHloCkW8TOgF/Nw2i0snIRa0gRQqiPHNVdfz3Fewqh0RaLDPpx89mL DBuvKAhbBfIkVl2h5u+MH7qEUWd6Xehjw6lQVhBQVE8OFCpfoc8M0lsDfhIiw1hn65cS V/5bWP1E2Luv/bzm2sA+XN+oym95yqQpKsKb/iOH3luFxIEmOWy6N76LOUxiyxCh9Fy0 EuDg== 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=A13xgUcKJbvVcGHaxHhy1bLmK7+DdR2OS5PBNZS2+IehRF6/HL8gCOTMfUJTWaduW0 iLiscDIrf6awbubMtTRRxFzrlm25w4Ta/a4SgA+9wV/Ef3eOIqybp3GqccO1Qlxt7oUH tpjZTiqTE6pMaaAoWNzKzXk1ZNLeawc51N2+HMRYMVKDCQcQXSQEiSyWBA7t0DVdUn9M 5NocnHK9L+wAE0H5vaW2bSg5uDOBxKh7DSXC34njN2b6+iFKtBMdxtdZQbC+NG9z6RhZ FG3V2bDDlf54cs0CtlZTaBulJUB8AHTEVpUCq12xA+K6fYTKvYqY/lyvh6vcOntlR8R2 4DUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tH0AvFd4; 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 64-v6si7893197pgd.509.2018.06.29.14.02.10; Fri, 29 Jun 2018 14:02:26 -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=tH0AvFd4; 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 S936901AbeF2Sz3 (ORCPT + 99 others); Fri, 29 Jun 2018 14:55:29 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37118 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936821AbeF2SxE (ORCPT ); Fri, 29 Jun 2018 14:53:04 -0400 Received: by mail-pg0-f67.google.com with SMTP id n15-v6so1128025pgv.4; Fri, 29 Jun 2018 11:53:04 -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=tH0AvFd46YI7DgafJbrb7B8bJXn4YQTXrhO0kFLz2U0C98Nl4wgo3CrqwcWwecni8H YcQyiY9la42z2JlMLp+s2ct9oq6o6o6qlAp05fqDBa+JTQOh/YMbWlofwwNo/ZmIDroF rKyQoYMXTwblSGR8mlGCA9TYXLx9txa2zsMrRTQ2qAHoMIW9BlP5bPDK3Xo581gPfktn 2HUMlj1QlZsToUjhWAe5FjPV7x6Y77Qm3ESk1idYSiBrMGzBCplCSOTWv54V8PTd3WKi O06iOzHOFeXnHAYsAI+GaCHwqd/p/lM9BeRx2EzcFldwvwOM0N6kiJP0qOugQ/1jNvJ9 iHXQ== 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=p9l4YLluP8o7yfY99Vf8jBAjpQsz0CjByZ7xzzefLIZnl4cX4ikJ+yP5tzF46HXo8z pKGYxYav/jyzAAUIxO9GaqVqfDP4oY+vg8xTno4XVQ9g5aGL+K2dRXJJv5qUQx+u4OrY 8LxUoviL33+uyt2W6cnyWR0xW4fJvs5ssB8BHp58TEhTBHyC+etmTVZTarYXRBKq6Rab v5cgjhihJHHBWWeQbfauXeTLOLlAImYLcMcad7TDFNedEvdAf1MXQhBKXcF9zUwe0eT4 azoEleuyqPYeDCzNUF6hT3swL8la1O13d4Z1T2HOROgERcRG97N4Vm5XZ/4Era3Bm7g/ vZiw== X-Gm-Message-State: APt69E1YPJjSrWGumfNRyqm2T+eFD4kxYc2f0OC1fZCvKIYLCiqG+1P4 MIq1MfY4vD0UDUIt70G5+e4+/w== X-Received: by 2002:a63:541:: with SMTP id 62-v6mr13391928pgf.368.1530298383845; Fri, 29 Jun 2018 11:53:03 -0700 (PDT) Received: from mappy.world.mentorg.com ([2602:306:cc3b:f020:7cd8:9ad7:a375:e853]) by smtp.googlemail.com with ESMTPSA id k13-v6sm27672308pfg.130.2018.06.29.11.53.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jun 2018 11:53:03 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam , linux-kernel@vger.kernel.org Subject: [PATCH v5 11/17] media: staging/imx: Loop through all registered subdevs for media links Date: Fri, 29 Jun 2018 11:49:55 -0700 Message-Id: <1530298220-5097-12-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530298220-5097-1-git-send-email-steve_longerbeam@mentor.com> References: <1530298220-5097-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