Selaa lähdekoodia

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>
Krystian Garbaciak 13 vuotta sitten
vanhempi
commit
632a5b01db
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      drivers/base/regmap/regmap.c

+ 3 - 2
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;