hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/video/fbdev/fsl-diu-fb.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
34 *
....@@ -9,12 +10,6 @@
910 * York Sun <yorksun@freescale.com>
1011 *
1112 * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix
12
- *
13
- * This program is free software; you can redistribute it and/or modify it
14
- * under the terms of the GNU General Public License as published by the
15
- * Free Software Foundation; either version 2 of the License, or (at your
16
- * option) any later version.
17
- *
1813 */
1914
2015 #include <linux/module.h>
....@@ -1292,6 +1287,7 @@
12921287 dev_warn(info->dev,
12931288 "MFB_SET_PIXFMT value of 0x%08x is deprecated.\n",
12941289 MFB_SET_PIXFMT_OLD);
1290
+ fallthrough;
12951291 case MFB_SET_PIXFMT:
12961292 if (copy_from_user(&pix_fmt, buf, sizeof(pix_fmt)))
12971293 return -EFAULT;
....@@ -1301,6 +1297,7 @@
13011297 dev_warn(info->dev,
13021298 "MFB_GET_PIXFMT value of 0x%08x is deprecated.\n",
13031299 MFB_GET_PIXFMT_OLD);
1300
+ fallthrough;
13041301 case MFB_GET_PIXFMT:
13051302 pix_fmt = ad->pix_fmt;
13061303 if (copy_to_user(buf, &pix_fmt, sizeof(pix_fmt)))
....@@ -1453,7 +1450,7 @@
14531450 return res;
14541451 }
14551452
1456
-static struct fb_ops fsl_diu_ops = {
1453
+static const struct fb_ops fsl_diu_ops = {
14571454 .owner = THIS_MODULE,
14581455 .fb_check_var = fsl_diu_check_var,
14591456 .fb_set_par = fsl_diu_set_par,
....@@ -1575,8 +1572,7 @@
15751572
15761573 unregister_framebuffer(info);
15771574 unmap_video_memory(info);
1578
- if (&info->cmap)
1579
- fb_dealloc_cmap(&info->cmap);
1575
+ fb_dealloc_cmap(&info->cmap);
15801576
15811577 mfbi->registered = 0;
15821578 }
....@@ -1925,7 +1921,7 @@
19251921 pr_info("Freescale Display Interface Unit (DIU) framebuffer driver\n");
19261922
19271923 #ifdef CONFIG_NOT_COHERENT_CACHE
1928
- np = of_find_node_by_type(NULL, "cpu");
1924
+ np = of_get_cpu_node(0, NULL);
19291925 if (!np) {
19301926 pr_err("fsl-diu-fb: can't find 'cpu' device node\n");
19311927 return -ENODEV;