Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: v4l2-fwnode: Simplify v4l2_async_nf_parse_fwnode_endpoints()

There are only one user left of __v4l2_async_nf_parse_fwnode_ep()
since [1], v4l2_async_nf_parse_fwnode_endpoints(). The two
functions can be merged.

The merge of the two highlights a dead code block conditioned by the
argument 'has_port' that always is false and can therefor be removed.

1. commit 0ae426ebd0dcef81 ("media: v4l2-fwnode: Remove v4l2_async_notifier_parse_fwnode_endpoints_by_port()")

[Sakari Ailus: Aligned some lines to opening parentheses.]

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Niklas Söderlund and committed by
Mauro Carvalho Chehab
10aacfec 12f6517f

+5 -26
+5 -26
drivers/media/v4l2-core/v4l2-fwnode.c
··· 839 839 return ret == -ENOTCONN ? 0 : ret; 840 840 } 841 841 842 - static int 843 - __v4l2_async_nf_parse_fwnode_ep(struct device *dev, 844 - struct v4l2_async_notifier *notifier, 845 - size_t asd_struct_size, unsigned int port, 846 - bool has_port, 847 - parse_endpoint_func parse_endpoint) 842 + int 843 + v4l2_async_nf_parse_fwnode_endpoints(struct device *dev, 844 + struct v4l2_async_notifier *notifier, 845 + size_t asd_struct_size, 846 + parse_endpoint_func parse_endpoint) 848 847 { 849 848 struct fwnode_handle *fwnode; 850 849 int ret = 0; ··· 861 862 if (!is_available) 862 863 continue; 863 864 864 - if (has_port) { 865 - struct fwnode_endpoint ep; 866 - 867 - ret = fwnode_graph_parse_endpoint(fwnode, &ep); 868 - if (ret) 869 - break; 870 - 871 - if (ep.port != port) 872 - continue; 873 - } 874 865 875 866 ret = v4l2_async_nf_fwnode_parse_endpoint(dev, notifier, 876 867 fwnode, ··· 873 884 fwnode_handle_put(fwnode); 874 885 875 886 return ret; 876 - } 877 - 878 - int 879 - v4l2_async_nf_parse_fwnode_endpoints(struct device *dev, 880 - struct v4l2_async_notifier *notifier, 881 - size_t asd_struct_size, 882 - parse_endpoint_func parse_endpoint) 883 - { 884 - return __v4l2_async_nf_parse_fwnode_ep(dev, notifier, asd_struct_size, 885 - 0, false, parse_endpoint); 886 887 } 887 888 EXPORT_SYMBOL_GPL(v4l2_async_nf_parse_fwnode_endpoints); 888 889