From: Krystian Garbaciak Date: Mon, 18 Jun 2012 12:04:29 +0000 (+0100) Subject: regmap: Fix work_buf switching for page update during virtual range access. X-Git-Tag: firefly_0821_release~3680^2~2414^2^3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=632a5b01db8cd4068a06f8a67720ea4f9b00d9b3;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 83a0166420a4..d912eb2d19ce 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -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;