Skip to content

Commit 413552b

Browse files
hormsnmenon
authored andcommitted
soc: ti: pruss: Avoid cast to incompatible function type
Rather than casting clk_unregister_mux to an incompatible function type provide a trivial wrapper with the correct signature for the use-case. Reported by clang-16 with W=1: drivers/soc/ti/pruss.c:158:38: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux, No functional change intended. Compile tested only. Signed-off-by: Simon Horman <horms@kernel.org> Reviewed-by: MD Danish Anwar <danishanwar@ti.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20230418-pruss-clk-cb-v1-1-549a7e7febe4@kernel.org Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 9f60d9d commit 413552b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/soc/ti/pruss.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ static void pruss_of_free_clk_provider(void *data)
3838
of_node_put(clk_mux_np);
3939
}
4040

41+
static void pruss_clk_unregister_mux(void *data)
42+
{
43+
clk_unregister_mux(data);
44+
}
45+
4146
static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
4247
char *mux_name, struct device_node *clks_np)
4348
{
@@ -93,8 +98,7 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
9398
goto put_clk_mux_np;
9499
}
95100

96-
ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux,
97-
clk_mux);
101+
ret = devm_add_action_or_reset(dev, pruss_clk_unregister_mux, clk_mux);
98102
if (ret) {
99103
dev_err(dev, "failed to add clkmux unregister action %d", ret);
100104
goto put_clk_mux_np;

0 commit comments

Comments
 (0)