All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: tcon-top: Fix return type warning
@ 2018-07-12  8:08 Maxime Ripard
  2018-07-12  8:35 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Ripard @ 2018-07-12  8:08 UTC (permalink / raw)
  To: dri-devel; +Cc: Maxime Ripard, Jernej Skrabec, Chen-Yu Tsai

When commit af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
was merged, the error handling path of the of_property_match_string was
changed to take into account the fact that the returned value of that
function wasn't an error pointer but an error code.

Unfortunately, this introduced a warning since the now returned value is an
integer, while the sun8i_tcon_top_register_gate function should return an
error pointer.

Fix that by calling ERR_PTR.

Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Chen-Yu Tsai <wens@csie.org>
Fixes: af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
index 046f8dd66f90..55fe398d8290 100644
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -99,7 +99,7 @@ static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
 
 	index = of_property_match_string(dev->of_node, "clock-names", parent);
 	if (index < 0)
-		return index;
+		return ERR_PTR(index);
 
 	parent_name = of_clk_get_parent_name(dev->of_node, index);
 
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/sun4i: tcon-top: Fix return type warning
  2018-07-12  8:08 [PATCH] drm/sun4i: tcon-top: Fix return type warning Maxime Ripard
@ 2018-07-12  8:35 ` Daniel Vetter
  2018-07-12 16:49   ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2018-07-12  8:35 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: Jernej Skrabec, Chen-Yu Tsai, dri-devel

On Thu, Jul 12, 2018 at 10:08:18AM +0200, Maxime Ripard wrote:
> When commit af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
> was merged, the error handling path of the of_property_match_string was
> changed to take into account the fact that the returned value of that
> function wasn't an error pointer but an error code.
> 
> Unfortunately, this introduced a warning since the now returned value is an
> integer, while the sun8i_tcon_top_register_gate function should return an
> error pointer.
> 
> Fix that by calling ERR_PTR.
> 
> Cc: Jernej Skrabec <jernej.skrabec@siol.net>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Fixes: af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Matches at least the seamntics of the other returns afaics.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> index 046f8dd66f90..55fe398d8290 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
> @@ -99,7 +99,7 @@ static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
>  
>  	index = of_property_match_string(dev->of_node, "clock-names", parent);
>  	if (index < 0)
> -		return index;
> +		return ERR_PTR(index);
>  
>  	parent_name = of_clk_get_parent_name(dev->of_node, index);
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/sun4i: tcon-top: Fix return type warning
  2018-07-12  8:35 ` Daniel Vetter
@ 2018-07-12 16:49   ` Maxime Ripard
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2018-07-12 16:49 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Jernej Skrabec, Chen-Yu Tsai, dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1253 bytes --]

On Thu, Jul 12, 2018 at 10:35:08AM +0200, Daniel Vetter wrote:
> On Thu, Jul 12, 2018 at 10:08:18AM +0200, Maxime Ripard wrote:
> > When commit af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
> > was merged, the error handling path of the of_property_match_string was
> > changed to take into account the fact that the returned value of that
> > function wasn't an error pointer but an error code.
> > 
> > Unfortunately, this introduced a warning since the now returned value is an
> > integer, while the sun8i_tcon_top_register_gate function should return an
> > error pointer.
> > 
> > Fix that by calling ERR_PTR.
> > 
> > Cc: Jernej Skrabec <jernej.skrabec@siol.net>
> > Cc: Chen-Yu Tsai <wens@csie.org>
> > Fixes: af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> 
> Matches at least the seamntics of the other returns afaics.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Applied, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-12 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-12  8:08 [PATCH] drm/sun4i: tcon-top: Fix return type warning Maxime Ripard
2018-07-12  8:35 ` Daniel Vetter
2018-07-12 16:49   ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.