diff mbox series

[1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated

Message ID 20201214213348.19675-1-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/1] v4l: fwnode: v4l2_async_notifier_parse_fwnode_endpoints is deprecated | expand

Commit Message

Sakari Ailus Dec. 14, 2020, 9:33 p.m. UTC
Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
Its functionality has been replaced by other, better functions. Also add a
reference to an example if someone ends up wandering here.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 include/media/v4l2-fwnode.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ezequiel Garcia Jan. 7, 2021, 7:31 p.m. UTC | #1
Hi Sakari,

On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> Its functionality has been replaced by other, better functions. Also add a
> reference to an example if someone ends up wandering here.
>

I'm working on a series to clean up the v4l2_async API a bit,
and came across this patch.

As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.

Adding Maxime and Yong Deng, it would be great to get rid of this,
so we can remove the API, which would also allow us to remove
some other internal functions and therefore make the API a bit cleaner.

Thanks,
Ezequiel

> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
>  include/media/v4l2-fwnode.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
> index 4365430eea6f..d0a1293379ab 100644
> --- a/include/media/v4l2-fwnode.h
> +++ b/include/media/v4l2-fwnode.h
> @@ -453,6 +453,10 @@ typedef int (*parse_endpoint_func)(struct device *dev,
>   * @parse_endpoint: Driver's callback function called on each V4L2 fwnode
>   *                 endpoint. Optional.
>   *
> + * DEPRECATED! This function is deprecated. Don't use it in new drivers.
> + * Instead see an example in cio2_parse_firmware() function in
> + * drivers/media/pci/intel/ipu3/ipu3-cio2.c .
> + *
>   * Parse the fwnode endpoints of the @dev device and populate the async sub-
>   * devices list in the notifier. The @parse_endpoint callback function is
>   * called for each endpoint with the corresponding async sub-device pointer to
> --
> 2.29.2
>
Sakari Ailus Jan. 7, 2021, 10:07 p.m. UTC | #2
Hi Ezequiel,

On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> Hi Sakari,
> 
> On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> >
> > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > Its functionality has been replaced by other, better functions. Also add a
> > reference to an example if someone ends up wandering here.
> >
> 
> I'm working on a series to clean up the v4l2_async API a bit,
> and came across this patch.
> 
> As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.

It may be that's the only one left. The intent was also to avoid anyone
proposing new ones.

> Adding Maxime and Yong Deng, it would be great to get rid of this,
> so we can remove the API, which would also allow us to remove
> some other internal functions and therefore make the API a bit cleaner.

Yes, that'd be very nice. Then we could remove it altogether.
Paul Kocialkowski Jan. 8, 2021, 9:57 a.m. UTC | #3
Hi,

On Fri 08 Jan 21, 00:07, Sakari Ailus wrote:
> Hi Ezequiel,
> 
> On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > Hi Sakari,
> > 
> > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > Its functionality has been replaced by other, better functions. Also add a
> > > reference to an example if someone ends up wandering here.
> > >
> > 
> > I'm working on a series to clean up the v4l2_async API a bit,
> > and came across this patch.
> > 
> > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
> 
> It may be that's the only one left. The intent was also to avoid anyone
> proposing new ones.
> 
> > Adding Maxime and Yong Deng, it would be great to get rid of this,
> > so we can remove the API, which would also allow us to remove
> > some other internal functions and therefore make the API a bit cleaner.
> 
> Yes, that'd be very nice. Then we could remove it altogether.

I've been touching that area a bit with my MIPI CSI-2 support series.
I'll try to get rid of it along the way if I need to respin the series,
or come up with a follow-up patch to remove the call to this function.

If I understand correctly, the preferred way now is to use:
- fwnode_graph_get_endpoint_by_id
- v4l2_fwnode_endpoint_parse
- v4l2_async_notifier_add_fwnode_remote_subdev

Is that correct? I think that's what I've been doing in the MIPI CSI-2
bridge drivers so far.

Cheers,

Paul
Sakari Ailus Jan. 8, 2021, 10:09 a.m. UTC | #4
Hi Paul,

On Fri, Jan 08, 2021 at 10:57:57AM +0100, Paul Kocialkowski wrote:
> Hi,
> 
> On Fri 08 Jan 21, 00:07, Sakari Ailus wrote:
> > Hi Ezequiel,
> > 
> > On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > > Hi Sakari,
> > > 
> > > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > > >
> > > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > > Its functionality has been replaced by other, better functions. Also add a
> > > > reference to an example if someone ends up wandering here.
> > > >
> > > 
> > > I'm working on a series to clean up the v4l2_async API a bit,
> > > and came across this patch.
> > > 
> > > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
> > 
> > It may be that's the only one left. The intent was also to avoid anyone
> > proposing new ones.
> > 
> > > Adding Maxime and Yong Deng, it would be great to get rid of this,
> > > so we can remove the API, which would also allow us to remove
> > > some other internal functions and therefore make the API a bit cleaner.
> > 
> > Yes, that'd be very nice. Then we could remove it altogether.
> 
> I've been touching that area a bit with my MIPI CSI-2 support series.
> I'll try to get rid of it along the way if I need to respin the series,
> or come up with a follow-up patch to remove the call to this function.
> 
> If I understand correctly, the preferred way now is to use:
> - fwnode_graph_get_endpoint_by_id
> - v4l2_fwnode_endpoint_parse
> - v4l2_async_notifier_add_fwnode_remote_subdev
> 
> Is that correct? I think that's what I've been doing in the MIPI CSI-2
> bridge drivers so far.

Yes, that's the preferred way.
Ezequiel Garcia Jan. 11, 2021, 12:59 a.m. UTC | #5
Hi Sakari,

On Thu, 7 Jan 2021 at 19:07, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
>
> Hi Ezequiel,
>
> On Thu, Jan 07, 2021 at 04:31:58PM -0300, Ezequiel Garcia wrote:
> > Hi Sakari,
> >
> > On Mon, 14 Dec 2020 at 18:45, Sakari Ailus <sakari.ailus@linux.intel.com> wrote:
> > >
> > > Document that v4l2_async_notifier_parse_fwnode_endpoints() is deprecated.
> > > Its functionality has been replaced by other, better functions. Also add a
> > > reference to an example if someone ends up wandering here.
> > >
> >
> > I'm working on a series to clean up the v4l2_async API a bit,
> > and came across this patch.
> >
> > As far as I can see, the only user of v4l2_async_notifier_parse_fwnode_endpoints
> > is drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c.
>
> It may be that's the only one left. The intent was also to avoid anyone
> proposing new ones.
>

If we want to avoid any users, how about we make it clear the function
is maybe not a good idea by renaming it to:

__v4l2_async_notifier_parse_fwnode_endpoints ?

Thanks,
Ezequiel
diff mbox series

Patch

diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index 4365430eea6f..d0a1293379ab 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -453,6 +453,10 @@  typedef int (*parse_endpoint_func)(struct device *dev,
  * @parse_endpoint: Driver's callback function called on each V4L2 fwnode
  *		    endpoint. Optional.
  *
+ * DEPRECATED! This function is deprecated. Don't use it in new drivers.
+ * Instead see an example in cio2_parse_firmware() function in
+ * drivers/media/pci/intel/ipu3/ipu3-cio2.c .
+ *
  * Parse the fwnode endpoints of the @dev device and populate the async sub-
  * devices list in the notifier. The @parse_endpoint callback function is
  * called for each endpoint with the corresponding async sub-device pointer to