soc: ti: pruss: Avoid cast to incompatible function type
authorSimon Horman <horms@kernel.org>
Tue, 18 Apr 2023 11:41:48 +0000 (13:41 +0200)
committerNishanth Menon <nm@ti.com>
Wed, 17 May 2023 14:13:05 +0000 (09:13 -0500)
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>
drivers/soc/ti/pruss.c

index 6882c86..e68441b 100644 (file)
@@ -38,6 +38,11 @@ static void pruss_of_free_clk_provider(void *data)
        of_node_put(clk_mux_np);
 }
 
+static void pruss_clk_unregister_mux(void *data)
+{
+       clk_unregister_mux(data);
+}
+
 static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
                               char *mux_name, struct device_node *clks_np)
 {
@@ -93,8 +98,7 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
                goto put_clk_mux_np;
        }
 
-       ret = devm_add_action_or_reset(dev, (void(*)(void *))clk_unregister_mux,
-                                      clk_mux);
+       ret = devm_add_action_or_reset(dev, pruss_clk_unregister_mux, clk_mux);
        if (ret) {
                dev_err(dev, "failed to add clkmux unregister action %d", ret);
                goto put_clk_mux_np;