hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * linux/drivers/video/omap2/omapfb-main.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 #include <linux/module.h>
....@@ -893,7 +882,7 @@
893882 / (var->bits_per_pixel >> 2);
894883 break;
895884 }
896
- /* fall through */
885
+ fallthrough;
897886 default:
898887 screen_width = fix->line_length / (var->bits_per_pixel >> 3);
899888 break;
....@@ -1165,16 +1154,12 @@
11651154 r = fbdev->ctrl->setcolreg(regno, red, green, blue,
11661155 transp, update_hw_pal);
11671156 */
1168
- /* Fallthrough */
11691157 r = -EINVAL;
11701158 break;
11711159 case OMAPFB_COLOR_RGB565:
11721160 case OMAPFB_COLOR_RGB444:
11731161 case OMAPFB_COLOR_RGB24P:
11741162 case OMAPFB_COLOR_RGB24U:
1175
- if (r != 0)
1176
- break;
1177
-
11781163 if (regno < 16) {
11791164 u32 pal;
11801165 pal = ((red >> (16 - var->red.length)) <<
....@@ -1291,7 +1276,7 @@
12911276 }
12921277 #endif
12931278
1294
-static struct fb_ops omapfb_ops = {
1279
+static const struct fb_ops omapfb_ops = {
12951280 .owner = THIS_MODULE,
12961281 .fb_open = omapfb_open,
12971282 .fb_release = omapfb_release,
....@@ -1892,12 +1877,8 @@
18921877
18931878 fbi = framebuffer_alloc(sizeof(struct omapfb_info),
18941879 fbdev->dev);
1895
-
1896
- if (fbi == NULL) {
1897
- dev_err(fbdev->dev,
1898
- "unable to allocate memory for plane info\n");
1880
+ if (!fbi)
18991881 return -ENOMEM;
1900
- }
19011882
19021883 clear_fb_info(fbi);
19031884