summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-04-22 16:19:53 +0300
committerWolfram Sang <wsa@the-dreams.de>2016-04-27 20:03:11 +0300
commit70719350ca250a8397b74f416a45df3d1868a1d2 (patch)
tree63e51f88abe93bbaf9ef0226f4b76c994061f746 /drivers/i2c
parent9f4d6f164229d4221272186597d9393f654adbb9 (diff)
downloadlinux-70719350ca250a8397b74f416a45df3d1868a1d2.tar.xz
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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 4c6282a78109..e87db0344708 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -912,10 +912,8 @@ mv64xxx_i2c_probe(struct platform_device *pd)
drv_data->clk = devm_clk_get(&pd->dev, NULL);
if (IS_ERR(drv_data->clk) && PTR_ERR(drv_data->clk) == -EPROBE_DEFER)
return -EPROBE_DEFER;
- if (!IS_ERR(drv_data->clk)) {
- clk_prepare(drv_data->clk);
- clk_enable(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_prepare_enable(drv_data->clk);
#endif
if (pdata) {
drv_data->freq_m = pdata->freq_m;
@@ -968,10 +966,8 @@ exit_reset:
exit_clk:
#if defined(CONFIG_HAVE_CLK)
/* Not all platforms have a clk */
- if (!IS_ERR(drv_data->clk)) {
- clk_disable(drv_data->clk);
- clk_unprepare(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_disable_unprepare(drv_data->clk);
#endif
return rc;
}
@@ -987,10 +983,8 @@ mv64xxx_i2c_remove(struct platform_device *dev)
reset_control_assert(drv_data->rstc);
#if defined(CONFIG_HAVE_CLK)
/* Not all platforms have a clk */
- if (!IS_ERR(drv_data->clk)) {
- clk_disable(drv_data->clk);
- clk_unprepare(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_disable_unprepare(drv_data->clk);
#endif
return 0;