iio: adc: rockchip: Fix clock initialization sequence
Subsystems (2)
PATCH 1/1 iio: adc: rockchip: Fix clock initialization sequence
clock_set_rate should be executed after devm_clk_get_enabled.
Fixes 97ad10bb2901 ("iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled")
Signed-off-by Simon Xue <[email protected]>
--- drivers/iio/adc/rockchip_saradc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/iio/adc/rockchip_saradc.c +8 -9
@@ -480,15 +480,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (info->reset)rockchip_saradc_reset_controller (info->reset); -/* -* Use a default value for the converter clock. -* This may become user-configurable in the future. -*/ - ret =clk_set_rate (info->clk, info->data->clk_rate); -if (ret <0 ) -return dev_err_probe (&pdev->dev, ret, -"failed to set adc clk rate\n" ); - ret =regulator_enable (info->vref);if (ret <0 ) return dev_err_probe(&pdev->dev, ret,
@@ -515,6 +506,14 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (IS_ERR (info->clk))return dev_err_probe (&pdev->dev,PTR_ERR (info->clk),"failed to get adc clock\n" ); +/* +* Use a default value for the converter clock. +* This may become user-configurable in the future. +*/ + ret =clk_set_rate (info->clk, info->data->clk_rate); +if (ret <0 ) +return dev_err_probe (&pdev->dev, ret, +"failed to set adc clk rate\n" );platform_set_drvdata (pdev, indio_dev);
Signature · 7 lines
2.34.1 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Am Mittwoch, 12. März 2025, 07:20:16 MEZ schrieb Simon Xue:
Quoted 4 lines
clock_set_rateshould be executed afterdevm_clk_get_enabled.Fixes 97ad10bb2901 ("iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled")Signed-off-by Simon Xue <[email protected]>
Reviewed-by Heiko Stuebner <[email protected]>
Quoted 40 lines
--- drivers/iio/adc/rockchip_saradc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)drivers/iio/adc/rockchip_saradc.c +8
-9@@ -480,15 +480,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (info->reset)rockchip_saradc_reset_controller (info->reset); -/* -* Use a default value for the converter clock. -* This may become user-configurable in the future. -*/ - ret =clk_set_rate (info->clk, info->data->clk_rate); -if (ret <0 ) -return dev_err_probe (&pdev->dev, ret, -"failed to set adc clk rate\n" ); - ret =regulator_enable (info->vref);if (ret <0 ) return dev_err_probe(&pdev->dev, ret,@@ -515,6 +506,14 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (IS_ERR (info->clk))return dev_err_probe (&pdev->dev,PTR_ERR (info->clk),"failed to get adc clock\n" ); +/* +* Use a default value for the converter clock. +* This may become user-configurable in the future. +*/ + ret =clk_set_rate (info->clk, info->data->clk_rate); +if (ret <0 ) +return dev_err_probe (&pdev->dev, ret, +"failed to set adc clk rate\n" );platform_set_drvdata (pdev, indio_dev);
Jonathan Cameron
maintainerQuoted 7 lines · On Wed, 12 Mar 2025 08:00:54 +0100 Heiko Stuebner <[email protected]> wrote:
Am Mittwoch, 12. März 2025, 07:20:16 MEZ schrieb Simon Xue:
Quoted 4 lines
clock_set_rateshould be executed afterdevm_clk_get_enabled.Fixes 97ad10bb2901 ("iio: adc: rockchip_saradc: Make use of devm_clk_get_enabled")Signed-off-by Simon Xue <[email protected]>Reviewed-by Heiko Stuebner <[email protected]>
ouch.
Applied and marked for stable.
Thanks,
Jonathan
Quoted 45 lines
Quoted 41 lines
--- drivers/iio/adc/rockchip_saradc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)drivers/iio/adc/rockchip_saradc.c +8
-9@@ -480,15 +480,6 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (info->reset)rockchip_saradc_reset_controller (info->reset); -/* -* Use a default value for the converter clock. -* This may become user-configurable in the future. -*/ - ret =clk_set_rate (info->clk, info->data->clk_rate); -if (ret <0 ) -return dev_err_probe (&pdev->dev, ret, -"failed to set adc clk rate\n" ); - ret =regulator_enable (info->vref);if (ret <0 ) return dev_err_probe(&pdev->dev, ret,@@ -515,6 +506,14 @@ static int rockchip_saradc_probe(struct platform_device *pdev)if (IS_ERR (info->clk))return dev_err_probe (&pdev->dev,PTR_ERR (info->clk),"failed to get adc clock\n" ); +/* +* Use a default value for the converter clock. +* This may become user-configurable in the future. +*/ + ret =clk_set_rate (info->clk, info->data->clk_rate); +if (ret <0 ) +return dev_err_probe (&pdev->dev, ret, +"failed to set adc clk rate\n" );platform_set_drvdata (pdev, indio_dev);