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

From: Krystian Garbaciak
Date: Mon Jun 18 2012 - 08:08:46 EST


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

Signed-off-by: Krystian Garbaciak <krystian.garbaciak@xxxxxxxxxxx>
---
drivers/base/regmap/regmap.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 83a0166..d912eb2 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;
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/