mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
eeprom: at24: drop redundant variable in at24_read()
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: Bartosz Golaszewski <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
14263b893a
commit
eb27fde273
1 changed files with 6 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue