diff options
| author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2025-11-12 09:57:57 +0200 |
|---|---|---|
| committer | Hans Verkuil <hverkuil+cisco@kernel.org> | 2026-01-14 23:33:02 +0100 |
| commit | 37a5b80a94cc6ca3b6a5c2999a6ad008ca2e6277 (patch) | |
| tree | 0597e3b2be306b7aa42d7eceb0a25252f7f890cc /drivers | |
| parent | e3d5436c7099881e3604826757c8d65acc2d94f3 (diff) | |
media: v4l2-fwnode: Allow passing NULL fwnode to endpoint parsers
v4l2_fwnode_endpoint_parse() and v4l2_fwnode_endpoint_alloc_parse() take
a fwnode as the first argument and leave it up to the caller to check a
valid fwnode has been obtained through various means. Instead, add a check
here so the callers won't need to do that anymore.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/media/v4l2-core/v4l2-fwnode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index cb153ce42c45..22ec702a4567 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -465,6 +465,9 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode, enum v4l2_mbus_type mbus_type; int rval; + if (!fwnode) + return -EINVAL; + pr_debug("===== begin parsing endpoint %pfw\n", fwnode); fwnode_property_read_u32(fwnode, "bus-type", &bus_type); |
