hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/video/fbdev/omap2/omapfb/dss/core.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/video/omap2/dss/core.c
34 *
....@@ -6,18 +7,6 @@
67 *
78 * Some code and ideas taken from drivers/video/omap/ driver
89 * by Imre Deak.
9
- *
10
- * This program is free software; you can redistribute it and/or modify it
11
- * under the terms of the GNU General Public License version 2 as published by
12
- * the Free Software Foundation.
13
- *
14
- * This program is distributed in the hope that it will be useful, but WITHOUT
15
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17
- * more details.
18
- *
19
- * You should have received a copy of the GNU General Public License along with
20
- * this program. If not, see <http://www.gnu.org/licenses/>.
2110 */
2211
2312 #define DSS_SUBSYS_NAME "CORE"
....@@ -99,40 +88,23 @@
9988 }
10089
10190 #if defined(CONFIG_FB_OMAP2_DSS_DEBUGFS)
102
-static int dss_debug_show(struct seq_file *s, void *unused)
91
+static int dss_show(struct seq_file *s, void *unused)
10392 {
10493 void (*func)(struct seq_file *) = s->private;
10594 func(s);
10695 return 0;
10796 }
10897
109
-static int dss_debug_open(struct inode *inode, struct file *file)
110
-{
111
- return single_open(file, dss_debug_show, inode->i_private);
112
-}
113
-
114
-static const struct file_operations dss_debug_fops = {
115
- .open = dss_debug_open,
116
- .read = seq_read,
117
- .llseek = seq_lseek,
118
- .release = single_release,
119
-};
98
+DEFINE_SHOW_ATTRIBUTE(dss);
12099
121100 static struct dentry *dss_debugfs_dir;
122101
123
-static int dss_initialize_debugfs(void)
102
+static void dss_initialize_debugfs(void)
124103 {
125104 dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
126
- if (IS_ERR(dss_debugfs_dir)) {
127
- int err = PTR_ERR(dss_debugfs_dir);
128
- dss_debugfs_dir = NULL;
129
- return err;
130
- }
131105
132106 debugfs_create_file("clk", S_IRUGO, dss_debugfs_dir,
133
- &dss_debug_dump_clocks, &dss_debug_fops);
134
-
135
- return 0;
107
+ &dss_debug_dump_clocks, &dss_fops);
136108 }
137109
138110 static void dss_uninitialize_debugfs(void)
....@@ -140,26 +112,19 @@
140112 debugfs_remove_recursive(dss_debugfs_dir);
141113 }
142114
143
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
115
+void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
144116 {
145
- struct dentry *d;
146
-
147
- d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir,
148
- write, &dss_debug_fops);
149
-
150
- return PTR_ERR_OR_ZERO(d);
117
+ debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, write, &dss_fops);
151118 }
152119 #else /* CONFIG_FB_OMAP2_DSS_DEBUGFS */
153
-static inline int dss_initialize_debugfs(void)
120
+static inline void dss_initialize_debugfs(void)
154121 {
155
- return 0;
156122 }
157123 static inline void dss_uninitialize_debugfs(void)
158124 {
159125 }
160
-int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
126
+void dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))
161127 {
162
- return 0;
163128 }
164129 #endif /* CONFIG_FB_OMAP2_DSS_DEBUGFS */
165130
....@@ -192,15 +157,11 @@
192157
193158 static int __init omap_dss_probe(struct platform_device *pdev)
194159 {
195
- int r;
196
-
197160 core.pdev = pdev;
198161
199162 dss_features_init(omapdss_get_version());
200163
201
- r = dss_initialize_debugfs();
202
- if (r)
203
- goto err_debugfs;
164
+ dss_initialize_debugfs();
204165
205166 if (def_disp_name)
206167 core.default_display_name = def_disp_name;
....@@ -208,10 +169,6 @@
208169 register_pm_notifier(&omap_dss_pm_notif_block);
209170
210171 return 0;
211
-
212
-err_debugfs:
213
-
214
- return r;
215172 }
216173
217174 static int omap_dss_remove(struct platform_device *pdev)
....@@ -250,9 +207,6 @@
250207 #ifdef CONFIG_FB_OMAP2_DSS_SDI
251208 sdi_init_platform_driver,
252209 #endif
253
-#ifdef CONFIG_FB_OMAP2_DSS_RFBI
254
- rfbi_init_platform_driver,
255
-#endif
256210 #ifdef CONFIG_FB_OMAP2_DSS_VENC
257211 venc_init_platform_driver,
258212 #endif
....@@ -273,9 +227,6 @@
273227 #endif
274228 #ifdef CONFIG_FB_OMAP2_DSS_VENC
275229 venc_uninit_platform_driver,
276
-#endif
277
-#ifdef CONFIG_FB_OMAP2_DSS_RFBI
278
- rfbi_uninit_platform_driver,
279230 #endif
280231 #ifdef CONFIG_FB_OMAP2_DSS_SDI
281232 sdi_uninit_platform_driver,