iio: dac: rockchip-flexbus-dac: Set fb0_isr after init_completion

Prevent panic caused by the completion not being initialized when the
interrupt is triggered.

Change-Id: I375d38505e1375983e74eadcf957b1d928bee355
Signed-off-by: Wesley Yao <wesley.yao@rock-chips.com>
This commit is contained in:
Wesley Yao
2025-02-08 16:20:01 +08:00
parent 483595ae11
commit 0e331cdb70

View File

@@ -359,11 +359,10 @@ static int rockchip_flexbus_dac_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev);
rkfb_dac->dev = &pdev->dev;
rkfb_dac->rkfb = rkfb;
rockchip_flexbus_set_fb0(rkfb, rkfb_dac, rockchip_flexbus_dac_isr);
ret = rockchip_flexbus_dac_parse_dt(rkfb_dac);
if (ret)
goto err_fb0;
return ret;
mutex_init(&rkfb_dac->lock);
init_completion(&rkfb_dac->completion);
@@ -406,12 +405,12 @@ static int rockchip_flexbus_dac_probe(struct platform_device *pdev)
if (ret)
goto err_mutex_destroy;
rockchip_flexbus_set_fb0(rkfb, rkfb_dac, rockchip_flexbus_dac_isr);
return ret;
err_mutex_destroy:
mutex_destroy(&rkfb_dac->lock);
err_fb0:
rockchip_flexbus_set_fb0(rkfb, NULL, NULL);
return ret;
}
@@ -422,8 +421,8 @@ static int rockchip_flexbus_dac_remove(struct platform_device *pdev)
struct rockchip_flexbus_dac *rkfb_dac = iio_priv(indio_dev);
struct rockchip_flexbus *rkfb = rkfb_dac->rkfb;
mutex_destroy(&rkfb_dac->lock);
rockchip_flexbus_set_fb0(rkfb, NULL, NULL);
mutex_destroy(&rkfb_dac->lock);
return 0;
}