drm/sun4i: tcon-top: Fix return type warning
Subsystems (5)
PATCH 1/1 drm/sun4i: tcon-top: Fix return type warning
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.
--- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun8i_tcon_top.c +1 -1
@@ -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);
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Maxime Ripard
When commit
af11942ee44e("drm/sun4i: tcon-top: Cleanup clock handling") was merged, the error handling path of theof_property_match_stringwas 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_gatefunction should return an error pointer.
Quoted 8 lines
Fix that by calling
ERR_PTR.Cc Jernej Skrabec <[email protected]>Cc Chen-Yu Tsai <[email protected]>Fixes af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")Reported-by kbuild test robot <[email protected]>Reported-by Stephen Rothwell <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Matches at least the seamntics of the other returns afaics.
Quoted 24 lines
--- drivers/gpu/drm/sun4i/sun8i_tcon_top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/sun4i/sun8i_tcon_top.c +1
-1@@ -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);Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maxime Ripard
AppliedQuoted 19 lines · Daniel Vetter
Quoted 9 lines · Maxime Ripard
When commit
af11942ee44e("drm/sun4i: tcon-top: Cleanup clock handling") was merged, the error handling path of theof_property_match_stringwas 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_gatefunction should return an error pointer.Quoted 8 lines
Fix that by calling
ERR_PTR.Cc Jernej Skrabec <[email protected]>Cc Chen-Yu Tsai <[email protected]>Fixes af11942ee44e ("drm/sun4i: tcon-top: Cleanup clock handling")Reported-by kbuild test robot <[email protected]>Reported-by Stephen Rothwell <[email protected]>Signed-off-by Maxime Ripard <[email protected]>
Quoted 3 lines
Matches at least the seamntics of the other returns afaics.
Reviewed-by Daniel Vetter <[email protected]>
Applied, thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel