| .. | .. |
|---|
| 277 | 277 | |
|---|
| 278 | 278 | blk = krealloc(rbnode->block, |
|---|
| 279 | 279 | blklen * map->cache_word_size, |
|---|
| 280 | | - GFP_KERNEL); |
|---|
| 280 | + map->alloc_flags); |
|---|
| 281 | 281 | if (!blk) |
|---|
| 282 | 282 | return -ENOMEM; |
|---|
| 283 | 283 | |
|---|
| .. | .. |
|---|
| 286 | 286 | if (BITS_TO_LONGS(blklen) > BITS_TO_LONGS(rbnode->blklen)) { |
|---|
| 287 | 287 | present = krealloc(rbnode->cache_present, |
|---|
| 288 | 288 | BITS_TO_LONGS(blklen) * sizeof(*present), |
|---|
| 289 | | - GFP_KERNEL); |
|---|
| 289 | + map->alloc_flags); |
|---|
| 290 | 290 | if (!present) |
|---|
| 291 | 291 | return -ENOMEM; |
|---|
| 292 | 292 | |
|---|
| .. | .. |
|---|
| 320 | 320 | const struct regmap_range *range; |
|---|
| 321 | 321 | int i; |
|---|
| 322 | 322 | |
|---|
| 323 | | - rbnode = kzalloc(sizeof(*rbnode), GFP_KERNEL); |
|---|
| 323 | + rbnode = kzalloc(sizeof(*rbnode), map->alloc_flags); |
|---|
| 324 | 324 | if (!rbnode) |
|---|
| 325 | 325 | return NULL; |
|---|
| 326 | 326 | |
|---|
| .. | .. |
|---|
| 346 | 346 | } |
|---|
| 347 | 347 | |
|---|
| 348 | 348 | rbnode->block = kmalloc_array(rbnode->blklen, map->cache_word_size, |
|---|
| 349 | | - GFP_KERNEL); |
|---|
| 349 | + map->alloc_flags); |
|---|
| 350 | 350 | if (!rbnode->block) |
|---|
| 351 | 351 | goto err_free; |
|---|
| 352 | 352 | |
|---|
| 353 | 353 | rbnode->cache_present = kcalloc(BITS_TO_LONGS(rbnode->blklen), |
|---|
| 354 | 354 | sizeof(*rbnode->cache_present), |
|---|
| 355 | | - GFP_KERNEL); |
|---|
| 355 | + map->alloc_flags); |
|---|
| 356 | 356 | if (!rbnode->cache_present) |
|---|
| 357 | 357 | goto err_free_block; |
|---|
| 358 | 358 | |
|---|
| .. | .. |
|---|
| 453 | 453 | if (!rbnode) |
|---|
| 454 | 454 | return -ENOMEM; |
|---|
| 455 | 455 | regcache_rbtree_set_register(map, rbnode, |
|---|
| 456 | | - reg - rbnode->base_reg, value); |
|---|
| 456 | + (reg - rbnode->base_reg) / map->reg_stride, |
|---|
| 457 | + value); |
|---|
| 457 | 458 | regcache_rbtree_insert(map, &rbtree_ctx->root, rbnode); |
|---|
| 458 | 459 | rbtree_ctx->cached_rbnode = rbnode; |
|---|
| 459 | 460 | } |
|---|