| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/drivers/video/omap2/omapfb-main.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Some code and ideas taken from drivers/video/omap/ driver |
|---|
| 8 | 9 | * 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/>. |
|---|
| 21 | 10 | */ |
|---|
| 22 | 11 | |
|---|
| 23 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 893 | 882 | / (var->bits_per_pixel >> 2); |
|---|
| 894 | 883 | break; |
|---|
| 895 | 884 | } |
|---|
| 896 | | - /* fall through */ |
|---|
| 885 | + fallthrough; |
|---|
| 897 | 886 | default: |
|---|
| 898 | 887 | screen_width = fix->line_length / (var->bits_per_pixel >> 3); |
|---|
| 899 | 888 | break; |
|---|
| .. | .. |
|---|
| 1165 | 1154 | r = fbdev->ctrl->setcolreg(regno, red, green, blue, |
|---|
| 1166 | 1155 | transp, update_hw_pal); |
|---|
| 1167 | 1156 | */ |
|---|
| 1168 | | - /* Fallthrough */ |
|---|
| 1169 | 1157 | r = -EINVAL; |
|---|
| 1170 | 1158 | break; |
|---|
| 1171 | 1159 | case OMAPFB_COLOR_RGB565: |
|---|
| 1172 | 1160 | case OMAPFB_COLOR_RGB444: |
|---|
| 1173 | 1161 | case OMAPFB_COLOR_RGB24P: |
|---|
| 1174 | 1162 | case OMAPFB_COLOR_RGB24U: |
|---|
| 1175 | | - if (r != 0) |
|---|
| 1176 | | - break; |
|---|
| 1177 | | - |
|---|
| 1178 | 1163 | if (regno < 16) { |
|---|
| 1179 | 1164 | u32 pal; |
|---|
| 1180 | 1165 | pal = ((red >> (16 - var->red.length)) << |
|---|
| .. | .. |
|---|
| 1291 | 1276 | } |
|---|
| 1292 | 1277 | #endif |
|---|
| 1293 | 1278 | |
|---|
| 1294 | | -static struct fb_ops omapfb_ops = { |
|---|
| 1279 | +static const struct fb_ops omapfb_ops = { |
|---|
| 1295 | 1280 | .owner = THIS_MODULE, |
|---|
| 1296 | 1281 | .fb_open = omapfb_open, |
|---|
| 1297 | 1282 | .fb_release = omapfb_release, |
|---|
| .. | .. |
|---|
| 1892 | 1877 | |
|---|
| 1893 | 1878 | fbi = framebuffer_alloc(sizeof(struct omapfb_info), |
|---|
| 1894 | 1879 | fbdev->dev); |
|---|
| 1895 | | - |
|---|
| 1896 | | - if (fbi == NULL) { |
|---|
| 1897 | | - dev_err(fbdev->dev, |
|---|
| 1898 | | - "unable to allocate memory for plane info\n"); |
|---|
| 1880 | + if (!fbi) |
|---|
| 1899 | 1881 | return -ENOMEM; |
|---|
| 1900 | | - } |
|---|
| 1901 | 1882 | |
|---|
| 1902 | 1883 | clear_fb_info(fbi); |
|---|
| 1903 | 1884 | |
|---|