Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70719350 authored by Thomas Petazzoni's avatar Thomas Petazzoni Committed by Wolfram Sang
Browse files

i2c: mv64xxx: use clk_{prepare_enable,disable_unprepare}



Instead of separately calling clk_prepare()/clk_enable(), use
clk_prepare_enable(), and instead of calling
clk_disable()/clk_unprepare(), use clk_disable_unprepare(). Those
handy shortcuts have been introduced specifically to simplify the
numerous call sites were both functions were called in sequence.

Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 9f4d6f16
Loading
Loading
Loading
Loading
+6 −12
Original line number Original line Diff line number Diff line
@@ -912,10 +912,8 @@ mv64xxx_i2c_probe(struct platform_device *pd)
	drv_data->clk = devm_clk_get(&pd->dev, NULL);
	drv_data->clk = devm_clk_get(&pd->dev, NULL);
	if (IS_ERR(drv_data->clk) && PTR_ERR(drv_data->clk) == -EPROBE_DEFER)
	if (IS_ERR(drv_data->clk) && PTR_ERR(drv_data->clk) == -EPROBE_DEFER)
		return -EPROBE_DEFER;
		return -EPROBE_DEFER;
	if (!IS_ERR(drv_data->clk)) {
	if (!IS_ERR(drv_data->clk))
		clk_prepare(drv_data->clk);
		clk_prepare_enable(drv_data->clk);
		clk_enable(drv_data->clk);
	}
#endif
#endif
	if (pdata) {
	if (pdata) {
		drv_data->freq_m = pdata->freq_m;
		drv_data->freq_m = pdata->freq_m;
@@ -968,10 +966,8 @@ mv64xxx_i2c_probe(struct platform_device *pd)
exit_clk:
exit_clk:
#if defined(CONFIG_HAVE_CLK)
#if defined(CONFIG_HAVE_CLK)
	/* Not all platforms have a clk */
	/* Not all platforms have a clk */
	if (!IS_ERR(drv_data->clk)) {
	if (!IS_ERR(drv_data->clk))
		clk_disable(drv_data->clk);
		clk_disable_unprepare(drv_data->clk);
		clk_unprepare(drv_data->clk);
	}
#endif
#endif
	return rc;
	return rc;
}
}
@@ -987,10 +983,8 @@ mv64xxx_i2c_remove(struct platform_device *dev)
		reset_control_assert(drv_data->rstc);
		reset_control_assert(drv_data->rstc);
#if defined(CONFIG_HAVE_CLK)
#if defined(CONFIG_HAVE_CLK)
	/* Not all platforms have a clk */
	/* Not all platforms have a clk */
	if (!IS_ERR(drv_data->clk)) {
	if (!IS_ERR(drv_data->clk))
		clk_disable(drv_data->clk);
		clk_disable_unprepare(drv_data->clk);
		clk_unprepare(drv_data->clk);
	}
#endif
#endif


	return 0;
	return 0;