devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, linux-acpi@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 5/8] v4l: Switch from V4L2 OF not V4L2 fwnode API
Date: Fri, 07 Apr 2017 13:32:54 +0300	[thread overview]
Message-ID: <14918382.izlyCngq8n@avalon> (raw)
In-Reply-To: <1491484330-12040-6-git-send-email-sakari.ailus@linux.intel.com>

Hi Sakari,

Thank you for the patch.

On Thursday 06 Apr 2017 16:12:07 Sakari Ailus wrote:
> Switch users of the v4l2_of_ APIs to the more generic v4l2_fwnode_ APIs.
> 
> Existing OF matching continues to be supported. omap3isp and smiapp
> drivers are converted to fwnode matching as well.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Acked-by: Benoit Parrot <bparrot@ti.com> # i2c/ov2569.c,
> am437x/am437x-vpfe.c and ti-vpe/cal.c ---
>  drivers/media/i2c/Kconfig                      |  9 ++++
>  drivers/media/i2c/adv7604.c                    |  7 +--
>  drivers/media/i2c/mt9v032.c                    |  7 +--
>  drivers/media/i2c/ov2659.c                     |  8 +--
>  drivers/media/i2c/s5c73m3/s5c73m3-core.c       |  7 +--
>  drivers/media/i2c/s5k5baf.c                    |  6 +--
>  drivers/media/i2c/smiapp/Kconfig               |  1 +
>  drivers/media/i2c/smiapp/smiapp-core.c         | 29 ++++++-----
>  drivers/media/i2c/tc358743.c                   | 11 ++--
>  drivers/media/i2c/tvp514x.c                    |  6 +--
>  drivers/media/i2c/tvp5150.c                    |  7 +--
>  drivers/media/i2c/tvp7002.c                    |  6 +--
>  drivers/media/platform/Kconfig                 |  3 ++
>  drivers/media/platform/am437x/Kconfig          |  1 +
>  drivers/media/platform/am437x/am437x-vpfe.c    |  8 +--
>  drivers/media/platform/atmel/Kconfig           |  1 +
>  drivers/media/platform/atmel/atmel-isc.c       |  8 +--
>  drivers/media/platform/exynos4-is/Kconfig      |  2 +
>  drivers/media/platform/exynos4-is/media-dev.c  |  6 +--
>  drivers/media/platform/exynos4-is/mipi-csis.c  |  6 +--
>  drivers/media/platform/omap3isp/isp.c          | 71 +++++++++++-----------
>  drivers/media/platform/pxa_camera.c            |  7 +--
>  drivers/media/platform/rcar-vin/Kconfig        |  1 +
>  drivers/media/platform/rcar-vin/rcar-core.c    |  6 +--
>  drivers/media/platform/soc_camera/Kconfig      |  1 +
>  drivers/media/platform/soc_camera/atmel-isi.c  |  7 +--
>  drivers/media/platform/soc_camera/soc_camera.c |  3 +-
>  drivers/media/platform/ti-vpe/cal.c            | 11 ++--
>  drivers/media/platform/xilinx/Kconfig          |  1 +
>  drivers/media/platform/xilinx/xilinx-vipp.c    | 59 +++++++++++----------
>  include/media/v4l2-fwnode.h                    |  4 +-
>  31 files changed, 176 insertions(+), 134 deletions(-)
> 
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index cee1dae..6b2423a 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -210,6 +210,7 @@ config VIDEO_ADV7604
>  	depends on GPIOLIB || COMPILE_TEST
>  	select HDMI
>  	select MEDIA_CEC_EDID
> +	select V4L2_FWNODE

What happens when building the driver on a platform that includes neither OF 
nor ACPI support ?

>  	---help---
>  	  Support for the Analog Devices ADV7604 video decoder.
> 

[snip]

How have you checked that you haven't missed any entry in the Kconfig files ?

[snip]

> diff --git a/drivers/media/platform/omap3isp/isp.c
> b/drivers/media/platform/omap3isp/isp.c index 084ecf4a..95850b9 100644
> --- a/drivers/media/platform/omap3isp/isp.c
> +++ b/drivers/media/platform/omap3isp/isp.c

[snip]

> @@ -2024,43 +2025,42 @@ enum isp_of_phy {
>  	ISP_OF_PHY_CSIPHY2,
>  };
> 
> -static int isp_of_parse_node(struct device *dev, struct device_node *node,
> -			     struct isp_async_subdev *isd)
> +static int isp_fwnode_parse(struct device *dev, struct fwnode_handle *fwn,
> +			    struct isp_async_subdev *isd)
>  {
>  	struct isp_bus_cfg *buscfg = &isd->bus;
> -	struct v4l2_of_endpoint vep;
> +	struct v4l2_fwnode_endpoint vfwn;

vfwn is confusing to me, I think the variable name should show that it refers 
to an endpoint.

>  	unsigned int i;
>  	int ret;
> 
> -	ret = v4l2_of_parse_endpoint(node, &vep);
> +	ret = v4l2_fwnode_endpoint_parse(fwn, &vfwn);
>  	if (ret)
>  		return ret;
> 
> -	dev_dbg(dev, "parsing endpoint %s, interface %u\n", node->full_name,
> -		vep.base.port);
> +	dev_dbg(dev, "interface %u\n", vfwn.base.port);

Is there no way to keep the node name in the error message ?


[snip]

> @@ -2094,18 +2094,17 @@ static int isp_of_parse_node(struct device *dev,
> struct device_node *node, break;
> 
>  	default:
> -		dev_warn(dev, "%s: invalid interface %u\n", node->full_name,
> -			 vep.base.port);
> +		dev_warn(dev, "invalid interface %u\n", vfwn.base.port);

Ditto.

>  		break;
>  	}
> 
>  	return 0;
>  }
> 
> -static int isp_of_parse_nodes(struct device *dev,
> -			      struct v4l2_async_notifier *notifier)
> +static int isp_fwnodes_parse(struct device *dev,
> +			     struct v4l2_async_notifier *notifier)
>  {
> -	struct device_node *node = NULL;
> +	struct fwnode_handle *fwn = NULL;

As explained in the review of another patch from the same series, I wouldn't 
rename the variable.

>  	notifier->subdevs = devm_kcalloc(
>  		dev, ISP_MAX_SUBDEVS, sizeof(*notifier->subdevs), GFP_KERNEL);

[snip]

> @@ -2219,12 +2220,12 @@ static int isp_probe(struct platform_device *pdev)
>  	if (IS_ERR(isp->syscon))
>  		return PTR_ERR(isp->syscon);
> 
> -	ret = of_property_read_u32_index(pdev->dev.of_node, "syscon", 1,
> -					 &isp->syscon_offset);
> +	ret = of_property_read_u32_index(pdev->dev.of_node,
> +					 "syscon", 1, &isp->syscon_offset);

This change doesn't seem to be needed.

>  	if (ret)
>  		return ret;
> 
> -	ret = isp_of_parse_nodes(&pdev->dev, &isp->notifier);
> +	ret = isp_fwnodes_parse(&pdev->dev, &isp->notifier);
>  	if (ret < 0)
>  		return ret;
> 

[snip]

> diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c
> b/drivers/media/platform/xilinx/xilinx-vipp.c index feb3b2f..6a2721b 100644
> --- a/drivers/media/platform/xilinx/xilinx-vipp.c
> +++ b/drivers/media/platform/xilinx/xilinx-vipp.c

[snip]

> @@ -103,9 +103,10 @@ static int xvip_graph_build_one(struct
> xvip_composite_device *xdev, * the link.
>  		 */
>  		if (link.local_port >= local->num_pads) {
> -			dev_err(xdev->dev, "invalid port number %u on %s\n",
> -				link.local_port, link.local_node->full_name);
> -			v4l2_of_put_link(&link);
> +			dev_err(xdev->dev, "invalid port number %u for %s\n",
> +				link.local_port,
> +				to_of_node(link.local_node)->full_name);

This makes me believe that we're missing a fwnode_full_name() function.

> +			v4l2_fwnode_put_link(&link);
>  			ret = -EINVAL;
>  			break;
>  		}

[snip]

> diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
> index a675d8a..bc9cf51 100644
> --- a/include/media/v4l2-fwnode.h
> +++ b/include/media/v4l2-fwnode.h
> @@ -17,10 +17,10 @@
>  #ifndef _V4L2_FWNODE_H
>  #define _V4L2_FWNODE_H
> 
> +#include <linux/errno.h>
> +#include <linux/fwnode.h>
>  #include <linux/list.h>
>  #include <linux/types.h>
> -#include <linux/errno.h>
> -#include <linux/of_graph.h>
> 
>  #include <media/v4l2-mediabus.h>

This probably belongs to another patch (at least the alphabetical sorting 
does).

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2017-04-07 10:32 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 13:12 [PATCH v2 0/9] V4L2 fwnode support Sakari Ailus
2017-04-06 13:12 ` [PATCH v2 1/8] v4l: flash led class: Use fwnode_handle instead of device_node in init Sakari Ailus
     [not found]   ` <1491484330-12040-2-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-07  8:49     ` Laurent Pinchart
2017-04-07 10:20       ` Sakari Ailus
2017-04-08  1:59   ` kbuild test robot
     [not found] ` <1491484330-12040-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-06 13:12   ` [PATCH v2 2/8] v4l: fwnode: Support generic fwnode for parsing standardised properties Sakari Ailus
2017-04-07  9:44     ` Laurent Pinchart
2017-04-07 10:36       ` Sakari Ailus
2017-04-07 10:54         ` Laurent Pinchart
2017-04-07 13:03           ` Sakari Ailus
2017-04-07 21:30         ` Sakari Ailus
2017-04-06 13:12   ` [PATCH v2 3/8] v4l: async: Add fwnode match support Sakari Ailus
2017-04-07  9:49     ` Laurent Pinchart
2017-04-07 10:39       ` Sakari Ailus
2017-04-07 10:04     ` Laurent Pinchart
2017-04-07 10:45       ` Sakari Ailus
2017-04-07 10:47         ` Laurent Pinchart
2017-04-07 22:08           ` Sakari Ailus
2017-04-06 13:12   ` [PATCH v2 5/8] v4l: Switch from V4L2 OF not V4L2 fwnode API Sakari Ailus
2017-04-07 10:32     ` Laurent Pinchart [this message]
2017-04-07 10:58       ` Sakari Ailus
     [not found]         ` <20170407105805.GG4192-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-04-07 11:09           ` Laurent Pinchart
2017-04-07 22:55             ` Sakari Ailus
2017-04-10  9:21               ` Mika Westerberg
2017-04-10  9:59                 ` Sakari Ailus
2017-04-10 10:11                   ` Mika Westerberg
2017-04-10 10:17                     ` Sakari Ailus
2017-04-06 13:12 ` [PATCH v2 4/8] v4l: async: Provide interoperability between OF and fwnode matching Sakari Ailus
     [not found]   ` <1491484330-12040-5-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-07 10:07     ` Laurent Pinchart
2017-04-07 22:10       ` Sakari Ailus
     [not found]         ` <20170407221047.GL4192-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org>
2017-04-10 11:28           ` Sakari Ailus
2017-04-06 13:12 ` [PATCH v2 6/8] v4l: media/drv-intf/soc_mediabus.h: include dependent header file Sakari Ailus
     [not found]   ` <1491484330-12040-7-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-07 10:01     ` Laurent Pinchart
2017-04-07 22:56       ` Sakari Ailus
2017-04-06 13:12 ` [PATCH v2 7/8] docs-rst: media: Switch documentation to V4L2 fwnode API Sakari Ailus
     [not found]   ` <1491484330-12040-8-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-07  9:59     ` Laurent Pinchart
2017-04-07 23:02       ` Sakari Ailus
2017-04-06 13:12 ` [PATCH v2 8/8] v4l: Remove V4L2 OF framework in favour of V4L2 fwnode framework Sakari Ailus
2017-04-07  9:58   ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2017-04-06 13:10 [PATCH v2 0/9] V4L2 fwnode support Sakari Ailus
2017-04-06 13:10 ` [PATCH v2 5/8] v4l: Switch from V4L2 OF not V4L2 fwnode API Sakari Ailus
     [not found]   ` <1491484249-11964-6-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-04-07  6:19     ` kbuild test robot
2017-04-07  6:29   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14918382.izlyCngq8n@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).