diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-08-19 20:45:07 +0200 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-09-10 00:33:56 +0200 |
commit | 1a2b14e9cedae93e73222a77ce474a99eb7e3eaa (patch) | |
tree | d613d8fcc97e7c972da9e551a5b34f21f470789f /drivers/i2c/busses | |
parent | i2c: qcom-geni: Use goto for clearer exit path (diff) | |
download | linux-1a2b14e9cedae93e73222a77ce474a99eb7e3eaa.tar.xz linux-1a2b14e9cedae93e73222a77ce474a99eb7e3eaa.zip |
i2c: designware: Replace a while-loop by for-loop
Replace a while-loop by for-loop in i2c_dw_probe_lock_support() to
save a few lines of code.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-platdrv.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index df3dc1e8093e..d092532375b8 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -238,11 +238,9 @@ static int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev) int i = 0; int ret; - ptr = i2c_dw_semaphore_cb_table; - dev->semaphore_idx = -1; - while (ptr->probe) { + for (ptr = i2c_dw_semaphore_cb_table; ptr->probe; ptr++) { ret = ptr->probe(dev); if (ret) { /* @@ -254,7 +252,6 @@ static int i2c_dw_probe_lock_support(struct dw_i2c_dev *dev) return ret; i++; - ptr++; continue; } |