Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F017375F6D for ; Wed, 4 Mar 2026 22:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772663161; cv=none; b=TtdtDwKu4MRM8QyG2XY/Ni8iXb1fwMkPdmhyqJQrZd9pVYVbk69EelQmGDaDkFZO+lGT0FTch2qXk09kvCV95GV/qcCvgzDJeXN2ntSqZ0hmPkoHOsNg5lw/v+kzfNWFDs04kOgKy+pvJ4E+QRcgT50yt06RSYrSJRIy8LR9Wv0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772663161; c=relaxed/simple; bh=NjQoDe4SomRfbIRl+c4VRspCkG0r3I0iOnk63zSWT4U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IjZ9Poj8VUsBEXPu4lM6+AC+SCez5nu6ezvLbYJ+1A7z3ZBkHIE2ghsL0s9mPk2XQRX5brLh9XvsoF0eZY3A82yZX8OrC7VuXb2UFtByStrjp7U0TZrbOzvGA6dsmzStDfJ+gRuE0gtyqjqP77tMbCOCSEv4Sbpq/2pjiPaewds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BZJ3QLEz; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BZJ3QLEz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1772663160; x=1804199160; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=NjQoDe4SomRfbIRl+c4VRspCkG0r3I0iOnk63zSWT4U=; b=BZJ3QLEzUspAeuaty4vIi0guJMEzvcP+TrtjLqv3ij3PHNmyhf0ArzXZ eqrIHLpP4Td3hBzWB3AFlPcem+G58JIqo5BO7ByufRGG8FkSLCFO8ydW0 PLeTLNRk5Z6Z2EChe4pA0NtE0ANgbO1+6ulimZZz8YkJE/0C/rJor0V09 vGbOJQyHhtpSO9VIg8sl8kAtGsCJcwaBLZblQixf1a12i5UnxTz/DQ2EO z5UWg6PtNndOwhBRZY7ogVziozrBFJrslhxQTy6u3ie5t0PqBuXY6ifxj i+u1amYPCqUMhNn3B1Pqpso14KlqShHQmCNA8g3NbZBW4UB+twMFECial A==; X-CSE-ConnectionGUID: vGbT8DbiROyQOJxr5x7p2g== X-CSE-MsgGUID: NzsgSskrRNarVp1yBrwCGg== X-IronPort-AV: E=McAfee;i="6800,10657,11719"; a="73808137" X-IronPort-AV: E=Sophos;i="6.21,324,1763452800"; d="scan'208";a="73808137" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2026 14:25:59 -0800 X-CSE-ConnectionGUID: ag1MTfXATYucmr1gidRVVg== X-CSE-MsgGUID: fjmBZw4bRjeCq2oVp33nUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,324,1763452800"; d="scan'208";a="256361912" Received: from smoticic-mobl1.ger.corp.intel.com (HELO kekkonen.fi.intel.com) ([10.245.244.13]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2026 14:25:58 -0800 Received: from punajuuri.localdomain (unknown [192.168.240.130]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 34FC1120CA3; Thu, 05 Mar 2026 00:26:27 +0200 (EET) Received: from sailus by punajuuri.localdomain with local (Exim 4.98.2) (envelope-from ) id 1vxufi-0000000GO0e-3svi; Thu, 05 Mar 2026 00:26:26 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo From: Sakari Ailus To: linux-media@vger.kernel.org Cc: jacopo.mondi@ideasonboard.com, niklas.soderlund+renesas@ragnatech.se, antti.laakso@linux.intel.com Subject: [PATCH 1/1] media: v4l2-fwnode: Return -EPROBE_DEFER on parsing NULL or error eps Date: Thu, 5 Mar 2026 00:26:26 +0200 Message-ID: <20260304222626.3905532-1-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In general drivers get their firmware graph endpoints from system firmware, but on some systems this information is conveyed to drivers via software nodes. The software nodes may be instantiated only after the drivers are first probed, requiring drivers to explicitly issue -EPROBE_DEFER when endpoints aren't found. Instead of doing this in all (or at least most) drivers, make v4l2-fwnode endpoint parsing functions v4l2_fwnode_endpoint_parse() and v4l2_fwnode_endpoint_alloc_parse() return -EPROBE_DEFER when an endpoint is NULL or an error value. Signed-off-by: Sakari Ailus --- drivers/media/v4l2-core/v4l2-fwnode.c | 4 ++-- include/media/v4l2-fwnode.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 03daa8c4ff7a..23df9ca9e1ee 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -465,8 +465,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, enum v4l2_mbus_type mbus_type; int rval; - if (!fwnode) - return -EINVAL; + if (!IS_ERR_OR_NULL(fwnode)) + return -EPROBE_DEFER; pr_debug("===== begin parsing endpoint %pfw\n", fwnode); diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h index cd82e70ccbaa..44c985a12286 100644 --- a/include/media/v4l2-fwnode.h +++ b/include/media/v4l2-fwnode.h @@ -218,8 +218,9 @@ enum v4l2_fwnode_bus_type { * * Return: %0 on success or a negative error code on failure: * %-ENOMEM on memory allocation failure - * %-EINVAL on parsing failure, including @fwnode == NULL + * %-EINVAL on parsing failure * %-ENXIO on mismatching bus types + * %-EPROBE_DEFER on NULL or error @fwnode */ int v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep); @@ -276,8 +277,9 @@ void v4l2_fwnode_endpoint_free(struct v4l2_fwnode_endpoint *vep); * * Return: %0 on success or a negative error code on failure: * %-ENOMEM on memory allocation failure - * %-EINVAL on parsing failure, including @fwnode == NULL + * %-EINVAL on parsing failure * %-ENXIO on mismatching bus types + * %-EPROBE_DEFER on NULL or error @fwnode */ int v4l2_fwnode_endpoint_alloc_parse(struct fwnode_handle *fwnode, struct v4l2_fwnode_endpoint *vep); -- 2.47.3