hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2009 Simtec Electronics
34 * http://armlinux.simtec.co.uk/
45 * Ben Dooks <ben@simtec.co.uk>
56 *
67 * S3C24XX CPU Frequency scaling - debugfs status support
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.
118 */
129
1310 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -21,7 +18,7 @@
2118 #include <linux/seq_file.h>
2219 #include <linux/err.h>
2320
24
-#include <plat/cpu-freq-core.h>
21
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
2522
2623 static struct dentry *dbgfs_root;
2724 static struct dentry *dbgfs_file_io;
....@@ -63,18 +60,7 @@
6360 return 0;
6461 }
6562
66
-static int fops_board_open(struct inode *inode, struct file *file)
67
-{
68
- return single_open(file, board_show, NULL);
69
-}
70
-
71
-static const struct file_operations fops_board = {
72
- .open = fops_board_open,
73
- .read = seq_read,
74
- .llseek = seq_lseek,
75
- .release = single_release,
76
- .owner = THIS_MODULE,
77
-};
63
+DEFINE_SHOW_ATTRIBUTE(board);
7864
7965 static int info_show(struct seq_file *seq, void *p)
8066 {
....@@ -105,18 +91,7 @@
10591 return 0;
10692 }
10793
108
-static int fops_info_open(struct inode *inode, struct file *file)
109
-{
110
- return single_open(file, info_show, NULL);
111
-}
112
-
113
-static const struct file_operations fops_info = {
114
- .open = fops_info_open,
115
- .read = seq_read,
116
- .llseek = seq_lseek,
117
- .release = single_release,
118
- .owner = THIS_MODULE,
119
-};
94
+DEFINE_SHOW_ATTRIBUTE(info);
12095
12196 static int io_show(struct seq_file *seq, void *p)
12297 {
....@@ -162,19 +137,7 @@
162137 return 0;
163138 }
164139
165
-static int fops_io_open(struct inode *inode, struct file *file)
166
-{
167
- return single_open(file, io_show, NULL);
168
-}
169
-
170
-static const struct file_operations fops_io = {
171
- .open = fops_io_open,
172
- .read = seq_read,
173
- .llseek = seq_lseek,
174
- .release = single_release,
175
- .owner = THIS_MODULE,
176
-};
177
-
140
+DEFINE_SHOW_ATTRIBUTE(io);
178141
179142 static int __init s3c_freq_debugfs_init(void)
180143 {
....@@ -185,13 +148,13 @@
185148 }
186149
187150 dbgfs_file_io = debugfs_create_file("io-timing", S_IRUGO, dbgfs_root,
188
- NULL, &fops_io);
151
+ NULL, &io_fops);
189152
190153 dbgfs_file_info = debugfs_create_file("info", S_IRUGO, dbgfs_root,
191
- NULL, &fops_info);
154
+ NULL, &info_fops);
192155
193156 dbgfs_file_board = debugfs_create_file("board", S_IRUGO, dbgfs_root,
194
- NULL, &fops_board);
157
+ NULL, &board_fops);
195158
196159 return 0;
197160 }