summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2017-11-02 13:47:29 +0100
committerWolfram Sang <wsa@the-dreams.de>2017-11-27 18:53:02 +0100
commit91a5e63e3f9879e5030064a3c0d23c3777c4f4d0 (patch)
tree357a3f1f23663cf95c7ce620ac9e4936a40d12ab /drivers/i2c/busses
parent3f3a513985ce55d69922cc9b5a0e095432cdfbc4 (diff)
downloadlinux-91a5e63e3f9879e5030064a3c0d23c3777c4f4d0.tar.gz
linux-91a5e63e3f9879e5030064a3c0d23c3777c4f4d0.tar.bz2
linux-91a5e63e3f9879e5030064a3c0d23c3777c4f4d0.zip
i2c: sh_mobile: manually "inline" two short functions
Those two functions are very short and only called once. The code becomes easier to understand if the code is directly put into the main xfer function. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index cbaed24fb18f..02c2912bebb4 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -298,23 +298,6 @@ static int sh_mobile_i2c_init(struct sh_mobile_i2c_data *pd)
return 0;
}
-static void activate_ch(struct sh_mobile_i2c_data *pd)
-{
- /* Wake up device and enable clock */
- pm_runtime_get_sync(pd->dev);
- clk_prepare_enable(pd->clk);
-}
-
-static void deactivate_ch(struct sh_mobile_i2c_data *pd)
-{
- /* Disable channel */
- iic_set_clr(pd, ICCR, 0, ICCR_ICE);
-
- /* Disable clock and mark device as idle */
- clk_disable_unprepare(pd->clk);
- pm_runtime_put_sync(pd->dev);
-}
-
static unsigned char i2c_op(struct sh_mobile_i2c_data *pd,
enum sh_mobile_i2c_op op, unsigned char data)
{
@@ -717,7 +700,9 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
int i;
long timeout;
- activate_ch(pd);
+ /* Wake up device and enable clock */
+ pm_runtime_get_sync(pd->dev);
+ clk_prepare_enable(pd->clk);
/* Process all messages */
for (i = 0; i < num; i++) {
@@ -754,7 +739,12 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
break;
}
- deactivate_ch(pd);
+ /* Disable channel */
+ iic_set_clr(pd, ICCR, 0, ICCR_ICE);
+
+ /* Disable clock and mark device as idle */
+ clk_disable_unprepare(pd->clk);
+ pm_runtime_put_sync(pd->dev);
if (!err)
err = num;