| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * Register cache access API - rbtree caching support |
|---|
| 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 - rbtree caching support |
|---|
| 4 | +// |
|---|
| 5 | +// Copyright 2011 Wolfson Microelectronics plc |
|---|
| 6 | +// |
|---|
| 7 | +// Author: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> |
|---|
| 12 | 8 | |
|---|
| 13 | 9 | #include <linux/debugfs.h> |
|---|
| 14 | 10 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 33 | 29 | unsigned int blklen; |
|---|
| 34 | 30 | /* the actual rbtree node holding this block */ |
|---|
| 35 | 31 | struct rb_node node; |
|---|
| 36 | | -} __attribute__ ((packed)); |
|---|
| 32 | +}; |
|---|
| 37 | 33 | |
|---|
| 38 | 34 | struct regcache_rbtree_ctx { |
|---|
| 39 | 35 | struct rb_root root; |
|---|
| .. | .. |
|---|
| 177 | 173 | return 0; |
|---|
| 178 | 174 | } |
|---|
| 179 | 175 | |
|---|
| 180 | | -static int rbtree_open(struct inode *inode, struct file *file) |
|---|
| 181 | | -{ |
|---|
| 182 | | - return single_open(file, rbtree_show, inode->i_private); |
|---|
| 183 | | -} |
|---|
| 184 | | - |
|---|
| 185 | | -static const struct file_operations rbtree_fops = { |
|---|
| 186 | | - .open = rbtree_open, |
|---|
| 187 | | - .read = seq_read, |
|---|
| 188 | | - .llseek = seq_lseek, |
|---|
| 189 | | - .release = single_release, |
|---|
| 190 | | -}; |
|---|
| 176 | +DEFINE_SHOW_ATTRIBUTE(rbtree); |
|---|
| 191 | 177 | |
|---|
| 192 | 178 | static void rbtree_debugfs_init(struct regmap *map) |
|---|
| 193 | 179 | { |
|---|