Re: [PATCH v2 13/26] media: rcar: fix a debug printk

2017-11-02 Thread Niklas Söderlund
Hi Mauro,

Thanks for your patch.

On 2017-11-01 17:05:50 -0400, Mauro Carvalho Chehab wrote:
> Two orthogonal changesets caused a breakage at a printk
> inside rcar. Changeset 859969b38e2e
> ("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API")
> made davinci to use struct fwnode_handle instead of
> struct device_node. Changeset 68d9c47b1679
> ("media: Convert to using %pOF instead of full_name")
> changed the printk to not use ->full_name, but, instead,
> to rely on %pOF.
> 
> With both patches applied, the Kernel will do the wrong
> thing, as warned by smatch:
>   drivers/media/platform/rcar-vin/rcar-core.c:189 
> rvin_digital_graph_init() error: '%pOF' expects argument of type 'struct 
> device_node*', argument 4 has type 'void*'
> 
> So, change the logic to actually print the device name
> that was obtained before the print logic.
> 
> Fixes: 68d9c47b1679 ("media: Convert to using %pOF instead of full_name")
> Fixes: 859969b38e2e ("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API")
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  drivers/media/platform/rcar-vin/rcar-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
> b/drivers/media/platform/rcar-vin/rcar-core.c
> index 108d776f3265..ce5914f7a056 100644
> --- a/drivers/media/platform/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/rcar-vin/rcar-core.c
> @@ -186,8 +186,8 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
>   if (!vin->digital)
>   return -ENODEV;
>  
> - vin_dbg(vin, "Found digital subdevice %pOF\n",
> - to_of_node(vin->digital->asd.match.fwnode.fwnode));
> + vin_dbg(vin, "Found digital subdevice %s\n",
> + to_of_node(vin->digital->asd.match.fwnode.fwnode)->full_name);

For the same reasons as Laurent brings up in patch 14/26 I'm a bit 
sceptical to this change.

>  
>   vin->notifier.ops = _digital_notify_ops;
>   ret = v4l2_async_notifier_register(>v4l2_dev, >notifier);
> -- 
> 2.13.6
> 

-- 
Regards,
Niklas Söderlund


[PATCH v2 13/26] media: rcar: fix a debug printk

2017-11-01 Thread Mauro Carvalho Chehab
Two orthogonal changesets caused a breakage at a printk
inside rcar. Changeset 859969b38e2e
("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API")
made davinci to use struct fwnode_handle instead of
struct device_node. Changeset 68d9c47b1679
("media: Convert to using %pOF instead of full_name")
changed the printk to not use ->full_name, but, instead,
to rely on %pOF.

With both patches applied, the Kernel will do the wrong
thing, as warned by smatch:
drivers/media/platform/rcar-vin/rcar-core.c:189 
rvin_digital_graph_init() error: '%pOF' expects argument of type 'struct 
device_node*', argument 4 has type 'void*'

So, change the logic to actually print the device name
that was obtained before the print logic.

Fixes: 68d9c47b1679 ("media: Convert to using %pOF instead of full_name")
Fixes: 859969b38e2e ("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API")
Signed-off-by: Mauro Carvalho Chehab 
---
 drivers/media/platform/rcar-vin/rcar-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c 
b/drivers/media/platform/rcar-vin/rcar-core.c
index 108d776f3265..ce5914f7a056 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -186,8 +186,8 @@ static int rvin_digital_graph_init(struct rvin_dev *vin)
if (!vin->digital)
return -ENODEV;
 
-   vin_dbg(vin, "Found digital subdevice %pOF\n",
-   to_of_node(vin->digital->asd.match.fwnode.fwnode));
+   vin_dbg(vin, "Found digital subdevice %s\n",
+   to_of_node(vin->digital->asd.match.fwnode.fwnode)->full_name);
 
vin->notifier.ops = _digital_notify_ops;
ret = v4l2_async_notifier_register(>v4l2_dev, >notifier);
-- 
2.13.6