Commit eb27fde2 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Greg Kroah-Hartman

eeprom: at24: drop redundant variable in at24_read()

We can reuse ret instead of defining a loop-local status variable.
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Tested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14263b89
......@@ -395,17 +395,15 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
mutex_lock(&at24->lock);
while (count) {
int status;
status = at24_regmap_read(at24, buf, off, count);
if (status < 0) {
ret = at24_regmap_read(at24, buf, off, count);
if (ret < 0) {
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
return status;
return ret;
}
buf += status;
off += status;
count -= status;
buf += ret;
off += ret;
count -= ret;
}
mutex_unlock(&at24->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment