Skip to content

Commit a281c05

Browse files
committed
iio: jesd204: axi_adxcvr: make sure to disable the lane clock
On device unbind, make sure to see if there's a lane clock and disable it in case it's enabled. We also need to make sure there's no worker running against us. Fixes: a687f8f ("iio: cf_axi_adxcvr: Initial version") Signed-off-by: Nuno Sa <nuno.sa@analog.com>
1 parent ec1cbd5 commit a281c05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/iio/jesd204/axi_adxcvr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,6 +1218,10 @@ static int adxcvr_remove(struct platform_device *pdev)
12181218
{
12191219
struct adxcvr_state *st = platform_get_drvdata(pdev);
12201220

1221+
/* sync up the worker */
1222+
cancel_work_sync(&st->work);
1223+
if (!IS_ERR(st->lane_rate_div40_clk) && __clk_is_enabled(st->lane_rate_div40_clk))
1224+
clk_disable_unprepare(st->lane_rate_div40_clk);
12211225
adxcvr_eyescan_unregister(st);
12221226
if (st->clks[1])
12231227
clk_unregister_fixed_factor(st->clks[1]);

0 commit comments

Comments
 (0)