regcache.c (2cd148f1599a425f0f3ac6753da96a1a1aa3ce76) regcache.c (5fcd2560767cead8f0c741340e132c5417d9f73b)
1/*
2 * Register cache access API
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
5 *
6 * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 104 unchanged lines hidden (view full) ---

113 if (!map->num_reg_defaults)
114 return -EINVAL;
115 tmp_buf = kmemdup(map->reg_defaults, map->num_reg_defaults *
116 sizeof(struct reg_default), GFP_KERNEL);
117 if (!tmp_buf)
118 return -ENOMEM;
119 map->reg_defaults = tmp_buf;
120 } else {
1/*
2 * Register cache access API
3 *
4 * Copyright 2011 Wolfson Microelectronics plc
5 *
6 * Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 104 unchanged lines hidden (view full) ---

113 if (!map->num_reg_defaults)
114 return -EINVAL;
115 tmp_buf = kmemdup(map->reg_defaults, map->num_reg_defaults *
116 sizeof(struct reg_default), GFP_KERNEL);
117 if (!tmp_buf)
118 return -ENOMEM;
119 map->reg_defaults = tmp_buf;
120 } else {
121 /* Some devices such as PMIC's don't have cache defaults,
121 /* Some devices such as PMICs don't have cache defaults,
122 * we cope with this by reading back the HW registers and
123 * crafting the cache defaults by hand.
124 */
125 ret = regcache_hw_init(map);
126 if (ret < 0)
127 return ret;
128 }
129

--- 225 unchanged lines hidden ---
122 * we cope with this by reading back the HW registers and
123 * crafting the cache defaults by hand.
124 */
125 ret = regcache_hw_init(map);
126 if (ret < 0)
127 return ret;
128 }
129

--- 225 unchanged lines hidden ---