.. | .. |
---|
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 |
---|
9 | | - * it under the terms of the GNU General Public License version 2 as |
---|
10 | | - * published by the Free Software Foundation. |
---|
11 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
| 2 | +// |
---|
| 3 | +// Register cache access API |
---|
| 4 | +// |
---|
| 5 | +// Copyright 2011 Wolfson Microelectronics plc |
---|
| 6 | +// |
---|
| 7 | +// Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> |
---|
12 | 8 | |
---|
13 | 9 | #include <linux/bsearch.h> |
---|
14 | 10 | #include <linux/device.h> |
---|
.. | .. |
---|
347 | 343 | const char *name; |
---|
348 | 344 | bool bypass; |
---|
349 | 345 | |
---|
| 346 | + if (WARN_ON(map->cache_type == REGCACHE_NONE)) |
---|
| 347 | + return -EINVAL; |
---|
| 348 | + |
---|
350 | 349 | BUG_ON(!map->cache_ops); |
---|
351 | 350 | |
---|
352 | 351 | map->lock(map->lock_arg); |
---|
.. | .. |
---|
415 | 414 | int ret = 0; |
---|
416 | 415 | const char *name; |
---|
417 | 416 | bool bypass; |
---|
| 417 | + |
---|
| 418 | + if (WARN_ON(map->cache_type == REGCACHE_NONE)) |
---|
| 419 | + return -EINVAL; |
---|
418 | 420 | |
---|
419 | 421 | BUG_ON(!map->cache_ops); |
---|
420 | 422 | |
---|
.. | .. |
---|
721 | 723 | |
---|
722 | 724 | map->cache_bypass = true; |
---|
723 | 725 | |
---|
724 | | - ret = _regmap_raw_write(map, base, *data, count * val_bytes); |
---|
| 726 | + ret = _regmap_raw_write(map, base, *data, count * val_bytes, false); |
---|
725 | 727 | if (ret) |
---|
726 | 728 | dev_err(map->dev, "Unable to sync registers %#x-%#x. %d\n", |
---|
727 | 729 | base, cur - map->reg_stride, ret); |
---|