Skip to content

Commit c8b0f48

Browse files
nunojsaJRabacca
authored andcommitted
iio: frequency: ad9172: fix incompatible function type cast
Fix -Wcast-function-type-strict thrown by LLVM by explicity defining a compatible function to disable the clk. On top of that add proper error handling on devm_add_action_or_reset() call. Signed-off-by: Nuno Sá <[email protected]>
1 parent 972a202 commit c8b0f48

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

drivers/iio/frequency/ad9172.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ static int ad9172_finalize_setup(struct ad9172_state *st)
182182
return regmap_write(st->map, 0x596, 0x1c);
183183
}
184184

185+
static void ad9172_clk_disable(void *clk)
186+
{
187+
clk_disable_unprepare(clk);
188+
}
189+
185190
static int ad9172_setup(struct ad9172_state *st)
186191
{
187192
struct regmap *map = st->map;
@@ -353,9 +358,9 @@ static int ad9172_setup(struct ad9172_state *st)
353358
return ret;
354359
}
355360

356-
devm_add_action_or_reset(dev,
357-
(void(*)(void *))clk_disable_unprepare,
358-
st->conv.clk[CLK_DATA]);
361+
ret = devm_add_action_or_reset(dev, ad9172_clk_disable, st->conv.clk[CLK_DATA]);
362+
if (ret)
363+
return ret;
359364

360365
ad917x_jesd_set_sysref_enable(ad917x_h, !!st->jesd_subclass);
361366

@@ -398,9 +403,9 @@ static int ad9172_get_clks(struct cf_axi_converter *conv)
398403
if (ret < 0)
399404
return ret;
400405

401-
devm_add_action_or_reset(&conv->spi->dev,
402-
(void(*)(void *))clk_disable_unprepare,
403-
clk);
406+
ret = devm_add_action_or_reset(&conv->spi->dev, ad9172_clk_disable, clk);
407+
if (ret)
408+
return ret;
404409
}
405410

406411
of_clk_get_scale(conv->spi->dev.of_node,

0 commit comments

Comments
 (0)