From patchwork Tue May 16 09:55:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13242864 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 60DA9C77B7F for ; Tue, 16 May 2023 09:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232239AbjEPJ4Z (ORCPT ); Tue, 16 May 2023 05:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232226AbjEPJ4X (ORCPT ); Tue, 16 May 2023 05:56:23 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7072D4C for ; Tue, 16 May 2023 02:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684230974; x=1715766974; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AV1ntfdCKLDXge8ZWlKWhdzYhE1bwVlik0soL54lTlI=; b=je7Jo+wGTkIjYpqE+nRd6FCptISYxClMe0lgANJVsGYJ/5K0873TLb5S tcuSPad+Z/lwU8yqkpwo3Bt0G+lwxIlVCgjWP3mUPfyEIHwRgsWu4ajxt EREiVNAldN2grfMbTmzcnZcZGngqE7SX/RBBP3CYCU0dWCutBg/xJoSpH oXU/HsV7KlXcylNxGa/oxc5zdRjS2R/jybMOXN5VaQowAljt/zKdEY1q3 KqSU97T1/yikbI8FhFz6dXH+N/5YrRh7KMAa8UViwlN9rzdKui6IeuZEx 794Z6jycSkATWzd7Df4Q/nCzeG3+gPnwJ90F/fri8zt81Jnd0jIFh6c6R Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="354601477" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="354601477" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 02:55:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="731931850" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="731931850" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 02:55:48 -0700 Received: from punajuuri.localdomain (punajuuri.localdomain [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 52C8F122F72; Tue, 16 May 2023 12:55:36 +0300 (EEST) Received: from sailus by punajuuri.localdomain with local (Exim 4.94.2) (envelope-from ) id 1pyrOy-002ZAe-BF; Tue, 16 May 2023 12:55:28 +0300 From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Philipp Zabel , hverkuil@xs4all.nl, Francesco Dolcini , aishwarya.kothari@toradex.com, Robert Foss , Todor Tomov , Hyun Kwon , bingbu.cao@intel.com Subject: [PATCH v2 19/31] media: v4l: async: Try more connections Date: Tue, 16 May 2023 12:55:05 +0300 Message-Id: <20230516095517.611711-20-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230516095517.611711-1-sakari.ailus@linux.intel.com> References: <20230516095517.611711-1-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When an async sub-device is registered, it used to be that the first one of its connections were matched when found. Continue looking for matches until a notifier no longer has any. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-async.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index c24a709d45caa..4916f925792b3 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -930,6 +930,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) if (!v4l2_dev) continue; +again: asc = v4l2_async_find_match(notifier, sd); if (!asc) continue; @@ -942,13 +943,12 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) if (ret) goto err_unbind; - goto out_unlock; + goto again; } /* None matched, wait for hot-plugging */ list_add(&sd->async_list, &subdev_list); -out_unlock: mutex_unlock(&list_lock); return 0;