hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/base/regmap/regcache-rbtree.c
....@@ -1,14 +1,10 @@
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>
128
139 #include <linux/debugfs.h>
1410 #include <linux/device.h>
....@@ -33,7 +29,7 @@
3329 unsigned int blklen;
3430 /* the actual rbtree node holding this block */
3531 struct rb_node node;
36
-} __attribute__ ((packed));
32
+};
3733
3834 struct regcache_rbtree_ctx {
3935 struct rb_root root;
....@@ -177,17 +173,7 @@
177173 return 0;
178174 }
179175
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);
191177
192178 static void rbtree_debugfs_init(struct regmap *map)
193179 {