mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
iio: adc: rockchip-flexbus-adc: Set fb1_isr after init_completion
Prevent panic caused by the completion not being initialized when the interrupt is triggered. Change-Id: I797b0ea28a1b04744b0a64d77c00bd5590987420 Signed-off-by: Wesley Yao <wesley.yao@rock-chips.com>
This commit is contained in:
@@ -341,11 +341,10 @@ static int rockchip_flexbus_adc_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, indio_dev);
|
||||
rkfb_adc->dev = &pdev->dev;
|
||||
rkfb_adc->rkfb = rkfb;
|
||||
rockchip_flexbus_set_fb1(rkfb, rkfb_adc, rockchip_flexbus_adc_isr);
|
||||
|
||||
ret = rockchip_flexbus_adc_parse_dt(rkfb_adc);
|
||||
if (ret)
|
||||
goto err_fb1;
|
||||
return ret;
|
||||
|
||||
if (rkfb_adc->slave_mode) {
|
||||
rkfb_adc->ref_clk = devm_clk_get(&pdev->dev, "ref_clk");
|
||||
@@ -357,7 +356,7 @@ static int rockchip_flexbus_adc_probe(struct platform_device *pdev)
|
||||
ret = clk_prepare_enable(rkfb_adc->ref_clk);
|
||||
if (ret) {
|
||||
dev_err(rkfb_adc->dev, "failed to enable ref_clk.\n");
|
||||
goto err_fb1;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -401,14 +400,14 @@ static int rockchip_flexbus_adc_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
goto err_mutex_destroy;
|
||||
|
||||
rockchip_flexbus_set_fb1(rkfb, rkfb_adc, rockchip_flexbus_adc_isr);
|
||||
|
||||
return ret;
|
||||
|
||||
err_mutex_destroy:
|
||||
mutex_destroy(&rkfb_adc->lock);
|
||||
if (rkfb_adc->ref_clk)
|
||||
clk_disable_unprepare(rkfb_adc->ref_clk);
|
||||
err_fb1:
|
||||
rockchip_flexbus_set_fb1(rkfb, NULL, NULL);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -419,10 +418,10 @@ static int rockchip_flexbus_adc_remove(struct platform_device *pdev)
|
||||
struct rockchip_flexbus_adc *rkfb_adc = iio_priv(indio_dev);
|
||||
struct rockchip_flexbus *rkfb = rkfb_adc->rkfb;
|
||||
|
||||
rockchip_flexbus_set_fb1(rkfb, NULL, NULL);
|
||||
mutex_destroy(&rkfb_adc->lock);
|
||||
if (rkfb_adc->ref_clk)
|
||||
clk_disable_unprepare(rkfb_adc->ref_clk);
|
||||
rockchip_flexbus_set_fb1(rkfb, NULL, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user