diff options
author | Gao Pan <pandy.gao@nxp.com> | 2018-01-19 14:30:36 +0800 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:30:15 +0800 |
commit | 8c051dca127f433af43feab0ff49cf183451d3c0 (patch) | |
tree | 4180f3c3fa7d0d84ef429988f817a675f41f919d /drivers/i2c | |
parent | aa0b3d08ee93ae7020677e34fe9aaccee154e9bd (diff) |
MLK-17426 imx: lpi2c: add debug message when i2c peripheral clk doesn't work
add debug message when i2c peripheral clk rate is 0, then
directly return -EINVAL.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-imx-lpi2c.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c index aad245966f43..e46284d8b035 100644 --- a/drivers/i2c/busses/i2c-imx-lpi2c.c +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c @@ -228,6 +228,11 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx) lpi2c_imx_set_mode(lpi2c_imx); clk_rate = clk_get_rate(lpi2c_imx->clk_per); + if (!clk_rate) { + dev_dbg(&lpi2c_imx->adapter.dev, "clk_per rate is 0\n"); + return -EINVAL; + } + if (lpi2c_imx->mode == HS || lpi2c_imx->mode == ULTRA_FAST) filt = 0; else |