summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2018-01-19 14:30:36 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:46:18 +0800
commitc846995d43e1d236f059e8c0e0284f2417d10de9 (patch)
tree6e60922c51775b54053d4532d28eefc385b7bdac /drivers
parent96586cb843c428d65e74c69ebbe6ce72eb4ed717 (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> (Vipul: Fixed merge conflicts) Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com> (cherry picked from commit 1e6707bb5e0cd0dcf72af71f01792fe4e3721e7f)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-imx-lpi2c.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 780ff70f42e5..2d78378b6959 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -216,7 +216,12 @@ 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);
+ 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