From patchwork Tue May 16 09:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13242871 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 0F978C77B7A for ; Tue, 16 May 2023 09:56:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232268AbjEPJ4l (ORCPT ); Tue, 16 May 2023 05:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbjEPJ43 (ORCPT ); Tue, 16 May 2023 05:56:29 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 381824227 for ; Tue, 16 May 2023 02:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684230987; x=1715766987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mfH8JM6GmsDikhgOq+dswwN7kCZ1rdwKGOycxJG3JWc=; b=OhxS3hXw3aUG79widZlESOIeJ3CtwAZrrO/s1ftZLi6ftJHiVqStCLCz KZbCWz//lwYDdCx0JFFq884YAKDd+kf6XA/Im+oZcQUhohsjY4xg+NmlU LQ8phMe4eviZRnjjbV/HWeF2dxbGFuA9KGVMZxM2OTDybS+zfY1WCNUMz cdy2PkTg419NtofAoyCvDbqY6OhFLiYj1c3kV479DCVY4yHEJgAwLg1uB tJOo+NGuS41F408hb+Qsf+IPg6e9c4QTqScAHqty00KQXhyCGi5B1XI7x OVfkMEQMISb7l+gJbUehZaGF6RY0ZTZjCpRUyVYjSKow9vIJNoAVY35AM w==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="354601562" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="354601562" 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:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="731931877" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="731931877" 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 85CA2122FB8; 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-002ZBG-Hm; 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 29/31] media: qcom: Initialise V4L2 async notifier later Date: Tue, 16 May 2023 12:55:15 +0300 Message-Id: <20230516095517.611711-30-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 Initialise V4L2 async notifier and parse DT for async sub-devices later, just before registering the notifier. This way the V4L2 device has been registered before initialising the notifier which makes it possible to use it for debug prints. Signed-off-by: Sakari Ailus --- drivers/media/platform/qcom/camss/camss.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 006855bf076b7..b89e2bb5b505e 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -1615,14 +1615,6 @@ static int camss_probe(struct platform_device *pdev) if (!camss->vfe) return -ENOMEM; - v4l2_async_nf_init(&camss->notifier); - - num_subdevs = camss_of_parse_ports(camss); - if (num_subdevs < 0) { - ret = num_subdevs; - goto err_cleanup; - } - ret = camss_icc_get(camss); if (ret < 0) goto err_cleanup; @@ -1648,9 +1640,17 @@ static int camss_probe(struct platform_device *pdev) goto err_cleanup; } + v4l2_async_nf_init(&camss->notifier); + + num_subdevs = camss_of_parse_ports(camss); + if (num_subdevs < 0) { + ret = num_subdevs; + goto err_cleanup; + } + ret = camss_register_entities(camss); if (ret < 0) - goto err_register_entities; + goto err_cleanup; if (num_subdevs) { camss->notifier.ops = &camss_subdev_notifier_ops; @@ -1691,9 +1691,8 @@ static int camss_probe(struct platform_device *pdev) err_register_subdevs: camss_unregister_entities(camss); -err_register_entities: - v4l2_device_unregister(&camss->v4l2_dev); err_cleanup: + v4l2_device_unregister(&camss->v4l2_dev); v4l2_async_nf_cleanup(&camss->notifier); return ret;