regmap: Fix work_buf switching for page update during virtual range access.

After page update, orginal work_buf has to be restored regardless of
the result.

Signed-off-by: Krystian Garbaciak <krystian.garbaciak@diasemi.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
Krystian Garbaciak 2012-06-18 13:04:29 +01:00 committed by Mark Brown
parent 6863ca6227
commit 632a5b01db

View File

@ -693,10 +693,11 @@ static int _regmap_select_page(struct regmap *map, unsigned int *reg,
range->selector_mask,
win_page << range->selector_shift,
&page_chg);
if (ret < 0)
return ret;
map->work_buf = orig_work_buf;
if (ret < 0)
return ret;
}
*reg = range->window_start + win_offset;