History

Merge tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev updates from Helge Deller: "Lots of small fixes and code cleanups across most of the fbdev drivers. This includes conversions to use helper functions, const conversions, spelling fixes, help text updates, adding return value checks, small build fixes, and much more" * tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (59 commits) video: fbdev: kyro: make read-only array ODValues static const video: fbdev: offb: fix warning comparing pointer to 0 video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of video: fbdev: sm712fb: Fix crash in smtcfb_write() video: fbdev: s3c-fb: fix platform_get_irq.cocci warning video: fbdev: sm712fb: Fix crash in smtcfb_read() video: fbdev: via: check the return value of kstrdup() video: fbdev: au1100fb: Spelling s/palette/palette/ video: fbdev: atari: Atari 2 bpp (STe) palette bugfix video: fbdev: atari: Remove unused atafb_setcolreg() video: fbdev: atari: Convert to standard round_up() helper video: fbdev: atari: Fix TT High video mode video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: Use sysfs_emit() instead of snprintf() video: fbdev: s3c-fb: Use platform_get_irq() to get the interrupt video: fbdev: Fix wrong file path for pvr2fb.c in Kconfig help text video: fbdev: pxa3xx-gcu: Remove unnecessary print function dev_err() video: fbdev: pxa168fb: Remove unnecessary print function dev_err() ...

Linus Torvalds committed 4 years ago

Commit 9c4b86e2 parents 5bebe2c e445c8b54 files · +189 −233Browse files

Unified · Split

54 files
  1. Documentation/devicetree/bindings/display/simple-framebuffer.yaml +7 −5
  2. arch/parisc/include/asm/agp.h +2 −2
  3. arch/powerpc/include/asm/agp.h +2 −2
  4. arch/sparc/include/asm/agp.h +3 −3
  5. drivers/video/backlight/lm3630a_bl.c +0 −1
  6. drivers/video/backlight/qcom-wled.c +1 −0
  7. drivers/video/fbdev/Kconfig +1 −1
  8. drivers/video/fbdev/asiliantfb.c +1 −1
  9. drivers/video/fbdev/atafb.c +11 −24
  10. drivers/video/fbdev/atmel_lcdfb.c +6 −5
  11. drivers/video/fbdev/aty/aty128fb.c +6 −4
  12. drivers/video/fbdev/aty/mach64_ct.c +1 −3
  13. drivers/video/fbdev/aty/mach64_gx.c +0 −2
  14. drivers/video/fbdev/au1100fb.c +1 −1
  15. drivers/video/fbdev/au1100fb.h +1 −1
  16. drivers/video/fbdev/au1200fb.c +2 −2
  17. drivers/video/fbdev/cirrusfb.c +8 −8
  18. drivers/video/fbdev/controlfb.c +2 −0
  19. drivers/video/fbdev/core/fbcvt.c +21 −32
  20. drivers/video/fbdev/core/fbmem.c +2 −6
  21. drivers/video/fbdev/da8xx-fb.c +3 −4
  22. drivers/video/fbdev/imxfb.c +2 −0
  23. drivers/video/fbdev/kyro/STG4000InitDevice.c +1 −1
  24. drivers/video/fbdev/matrox/matroxfb_base.c +1 −1
  25. drivers/video/fbdev/mb862xx/mb862xxfb_accel.c +1 −1
  26. drivers/video/fbdev/mmp/hw/mmp_ctrl.c +2 −1
  27. drivers/video/fbdev/nvidia/nv_i2c.c +1 −1
  28. drivers/video/fbdev/ocfb.c +1 −1
  29. drivers/video/fbdev/offb.c +1 −1
  30. drivers/video/fbdev/omap/lcd_ams_delta.c +6 −10
  31. drivers/video/fbdev/omap/omapfb_main.c +7 −6
  32. drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c +1 −0
  33. drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +4 −4
  34. drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c +3 −4
  35. drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c +3 −4
  36. drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c +1 −1
  37. drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c +3 −4
  38. drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c +2 −1
  39. drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c +2 −1
  40. drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c +2 −1
  41. drivers/video/fbdev/omap2/omapfb/omapfb-main.c +0 −1
  42. drivers/video/fbdev/pxa168fb.c +6 −9
  43. drivers/video/fbdev/pxa3xx-gcu.c +3 −7
  44. drivers/video/fbdev/s3c-fb.c +8 −12
  45. drivers/video/fbdev/savage/savagefb.h +0 −1
  46. drivers/video/fbdev/savage/savagefb_driver.c +4 −3
  47. drivers/video/fbdev/sis/sis_main.c +1 −1
  48. drivers/video/fbdev/sm712fb.c +11 −35
  49. drivers/video/fbdev/smscufx.c +1 −2
  50. drivers/video/fbdev/ssd1307fb.c +3 −4
  51. drivers/video/fbdev/udlfb.c +4 −4
  52. drivers/video/fbdev/via/lcd.c +1 −1
  53. drivers/video/fbdev/via/viafbdev.c +10 −0
  54. drivers/video/fbdev/w100fb.c +12 −3
Documentation/devicetree/bindings/display/simple-framebuffer.yaml+7−5
@@ -52,11 +52,13 @@ description: |+ · 51 unmodified lines
52 52
53properties:53properties:
54 compatible:54 compatible:
55 items:55 oneOf:
56 - enum:56 - items:
57 - apple,simple-framebuffer57 - enum:
58 - allwinner,simple-framebuffer58 - apple,simple-framebuffer
59 - amlogic,simple-framebuffer59 - allwinner,simple-framebuffer
60 - amlogic,simple-framebuffer
61 - const: simple-framebuffer
60 - const: simple-framebuffer62 - const: simple-framebuffer
61 63
62 reg:64 reg:
arch/parisc/include/asm/agp.h+2−2
@@ -8,8 +8,8 @@ · 7 unmodified lines
8 *8 *
9 */9 */
10 10
11#define map_page_into_agp(page) /* nothing */11#define map_page_into_agp(page) do { } while (0)
12#define unmap_page_from_agp(page) /* nothing */12#define unmap_page_from_agp(page) do { } while (0)
13#define flush_agp_cache() mb()13#define flush_agp_cache() mb()
14 14
15/* GATT allocation. Returns/accepts GATT kernel virtual address. */15/* GATT allocation. Returns/accepts GATT kernel virtual address. */
arch/powerpc/include/asm/agp.h+2−2
@@ -5,8 +5,8 @@ · 4 unmodified lines
5 5
6#include <asm/io.h>6#include <asm/io.h>
7 7
8#define map_page_into_agp(page)8#define map_page_into_agp(page) do {} while (0)
9#define unmap_page_from_agp(page)9#define unmap_page_from_agp(page) do {} while (0)
10#define flush_agp_cache() mb()10#define flush_agp_cache() mb()
11 11
12/* GATT allocation. Returns/accepts GATT kernel virtual address. */12/* GATT allocation. Returns/accepts GATT kernel virtual address. */
arch/sparc/include/asm/agp.h+3−3
@@ -4,9 +4,9 @@ · 3 unmodified lines
4 4
5/* dummy for now */5/* dummy for now */
6 6
7#define map_page_into_agp(page)7#define map_page_into_agp(page) do { } while (0)
8#define unmap_page_from_agp(page)8#define unmap_page_from_agp(page) do { } while (0)
9#define flush_agp_cache() mb()9#define flush_agp_cache() mb()
10 10
11/* GATT allocation. Returns/accepts GATT kernel virtual address. */11/* GATT allocation. Returns/accepts GATT kernel virtual address. */
12#define alloc_gatt_pages(order) \12#define alloc_gatt_pages(order) \
drivers/video/backlight/lm3630a_bl.c+0−1
@@ -594,7 +594,6 @@ static int lm3630a_remove(struct i2c_client *client) · 593 unmodified lines
594 594
595 if (pchip->irq) {595 if (pchip->irq) {
596 free_irq(pchip->irq, pchip);596 free_irq(pchip->irq, pchip);
597 flush_workqueue(pchip->irqthread);
598 destroy_workqueue(pchip->irqthread);597 destroy_workqueue(pchip->irqthread);
599 }598 }
600 return 0;599 return 0;
drivers/video/backlight/qcom-wled.c+1−0
@@ -1734,6 +1734,7 @@ static const struct of_device_id wled_match_table[] = { · 1733 unmodified lines
1734 { .compatible = "qcom,pmi8994-wled", .data = (void *)4 },1734 { .compatible = "qcom,pmi8994-wled", .data = (void *)4 },
1735 { .compatible = "qcom,pmi8998-wled", .data = (void *)4 },1735 { .compatible = "qcom,pmi8998-wled", .data = (void *)4 },
1736 { .compatible = "qcom,pm660l-wled", .data = (void *)4 },1736 { .compatible = "qcom,pm660l-wled", .data = (void *)4 },
1737 { .compatible = "qcom,pm6150l-wled", .data = (void *)5 },
1737 { .compatible = "qcom,pm8150l-wled", .data = (void *)5 },1738 { .compatible = "qcom,pm8150l-wled", .data = (void *)5 },
1738 {}1739 {}
1739};1740};
drivers/video/fbdev/Kconfig+1−1
@@ -829,7 +829,7 @@ config FB_PVR2 · 828 unmodified lines
829 You can pass several parameters to the driver at boot time or at829 You can pass several parameters to the driver at boot time or at
830 module load time. The parameters look like "video=pvr2:XXX", where830 module load time. The parameters look like "video=pvr2:XXX", where
831 the meaning of XXX can be found at the end of the main source file831 the meaning of XXX can be found at the end of the main source file
832 (<file:drivers/video/pvr2fb.c>). Please see the file832 (<file:drivers/video/fbdev/pvr2fb.c>). Please see the file
833 <file:Documentation/fb/pvr2fb.rst>.833 <file:Documentation/fb/pvr2fb.rst>.
834 834
835config FB_OPENCORES835config FB_OPENCORES
drivers/video/fbdev/asiliantfb.c+1−1
@@ -110,7 +110,7 @@ static const struct fb_ops asiliantfb_ops = { · 109 unmodified lines
110static void asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dclk2_div)110static void asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dclk2_div)
111{111{
112 unsigned pixclock = *ppixclock;112 unsigned pixclock = *ppixclock;
113 unsigned Ftarget = 1000000 * (1000000 / pixclock);113 unsigned Ftarget;
114 unsigned n;114 unsigned n;
115 unsigned best_error = 0xffffffff;115 unsigned best_error = 0xffffffff;
116 unsigned best_m = 0xffffffff,116 unsigned best_m = 0xffffffff,
drivers/video/fbdev/atafb.c+11−24
@@ -76,8 +76,6 @@ · 75 unmodified lines
76#define SWITCH_SND7 0x8076#define SWITCH_SND7 0x80
77#define SWITCH_NONE 0x0077#define SWITCH_NONE 0x00
78 78
79#define up(x, r) (((x) + (r) - 1) & ~((r)-1))
80
81 79
82static int default_par; /* default resolution (0=none) */80static int default_par; /* default resolution (0=none) */
83 81
@@ -487,8 +485,8 @@ static struct fb_videomode atafb_modedb[] __initdata = { · 403 unmodified lines
487 "tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30,485 "tt-mid", 60, 640, 480, 31041, 120, 100, 8, 16, 140, 30,
488 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP486 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
489 }, {487 }, {
490 /* 1280x960, 29 kHz, 60 Hz (TT high) */488 /* 1280x960, 72 kHz, 72 Hz (TT high) */
491 "tt-high", 57, 640, 960, 31041, 120, 100, 8, 16, 140, 30,489 "tt-high", 57, 1280, 960, 7760, 260, 60, 36, 4, 192, 4,
492 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP490 0, FB_VMODE_NONINTERLACED | FB_VMODE_YWRAP
493 },491 },
494 492
@@ -1649,12 +1647,12 @@ static int falcon_pan_display(struct fb_var_screeninfo *var, · 1154 unmodified lines
1649 int bpp = info->var.bits_per_pixel;1647 int bpp = info->var.bits_per_pixel;
1650 1648
1651 if (bpp == 1)1649 if (bpp == 1)
1652 var->xoffset = up(var->xoffset, 32);1650 var->xoffset = round_up(var->xoffset, 32);
1653 if (bpp != 16)1651 if (bpp != 16)
1654 par->hw.falcon.xoffset = var->xoffset & 15;1652 par->hw.falcon.xoffset = var->xoffset & 15;
1655 else {1653 else {
1656 par->hw.falcon.xoffset = 0;1654 par->hw.falcon.xoffset = 0;
1657 var->xoffset = up(var->xoffset, 2);1655 var->xoffset = round_up(var->xoffset, 2);
1658 }1656 }
1659 par->hw.falcon.line_offset = bpp *1657 par->hw.falcon.line_offset = bpp *
1660 (info->var.xres_virtual - info->var.xres) / 16;1658 (info->var.xres_virtual - info->var.xres) / 16;
@@ -1683,9 +1681,9 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red, · 22 unmodified lines
1683 ((blue & 0xfc00) >> 8));1681 ((blue & 0xfc00) >> 8));
1684 if (regno < 16) {1682 if (regno < 16) {
1685 shifter_tt.color_reg[regno] =1683 shifter_tt.color_reg[regno] =
1686 (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) |1684 ((((red & 0xe000) >> 13) | ((red & 0x1000) >> 12)) << 8) |
1687 (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) |1685 ((((green & 0xe000) >> 13) | ((green & 0x1000) >> 12)) << 4) |
1688 ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);1686 ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
1689 ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) |1687 ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) |
1690 ((green & 0xfc00) >> 5) |1688 ((green & 0xfc00) >> 5) |
1691 ((blue & 0xf800) >> 11));1689 ((blue & 0xf800) >> 11));
@@ -1971,9 +1969,9 @@ static int stste_setcolreg(unsigned int regno, unsigned int red, · 279 unmodified lines
1971 green >>= 12;1969 green >>= 12;
1972 if (ATARIHW_PRESENT(EXTD_SHIFTER))1970 if (ATARIHW_PRESENT(EXTD_SHIFTER))
1973 shifter_tt.color_reg[regno] =1971 shifter_tt.color_reg[regno] =
1974 (((red & 0xe) >> 1) | ((red & 1) << 3) << 8) |1972 ((((red & 0xe) >> 1) | ((red & 1) << 3)) << 8) |
1975 (((green & 0xe) >> 1) | ((green & 1) << 3) << 4) |1973 ((((green & 0xe) >> 1) | ((green & 1) << 3)) << 4) |
1976 ((blue & 0xe) >> 1) | ((blue & 1) << 3);1974 ((blue & 0xe) >> 1) | ((blue & 1) << 3);
1977 else1975 else
1978 shifter_tt.color_reg[regno] =1976 shifter_tt.color_reg[regno] =
1979 ((red & 0xe) << 7) |1977 ((red & 0xe) << 7) |
@@ -2268,7 +2266,7 @@ static int pan_display(struct fb_var_screeninfo *var, struct fb_info *info) · 288 unmodified lines
2268 if (!fbhw->set_screen_base ||2266 if (!fbhw->set_screen_base ||
2269 (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))2267 (!ATARIHW_PRESENT(EXTD_SHIFTER) && var->xoffset))
2270 return -EINVAL;2268 return -EINVAL;
2271 var->xoffset = up(var->xoffset, 16);2269 var->xoffset = round_up(var->xoffset, 16);
2272 par->screen_base = screen_base +2270 par->screen_base = screen_base +
2273 (var->yoffset * info->var.xres_virtual + var->xoffset)2271 (var->yoffset * info->var.xres_virtual + var->xoffset)
2274 * info->var.bits_per_pixel / 8;2272 * info->var.bits_per_pixel / 8;
@@ -2406,16 +2404,6 @@ static void atafb_set_disp(struct fb_info *info) · 131 unmodified lines
2406 atari_stram_to_virt(info->fix.smem_start));2404 atari_stram_to_virt(info->fix.smem_start));
2407}2405}
2408 2406
2409static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
2410 u_int transp, struct fb_info *info)
2411{
2412 red >>= 8;
2413 green >>= 8;
2414 blue >>= 8;
2415
2416 return info->fbops->fb_setcolreg(regno, red, green, blue, transp, info);
2417}
2418
2419static int2407static int
2420atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)2408atafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
2421{2409{
@@ -2726,7 +2714,6 @@ static struct fb_ops atafb_ops = { · 304 unmodified lines
2726 .owner = THIS_MODULE,2714 .owner = THIS_MODULE,
2727 .fb_check_var = atafb_check_var,2715 .fb_check_var = atafb_check_var,
2728 .fb_set_par = atafb_set_par,2716 .fb_set_par = atafb_set_par,
2729 .fb_setcolreg = atafb_setcolreg,
2730 .fb_blank = atafb_blank,2717 .fb_blank = atafb_blank,
2731 .fb_pan_display = atafb_pan_display,2718 .fb_pan_display = atafb_pan_display,
2732 .fb_fillrect = atafb_fillrect,2719 .fb_fillrect = atafb_fillrect,
drivers/video/fbdev/atmel_lcdfb.c+6−5
@@ -1062,15 +1062,16 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) · 1061 unmodified lines
1062 1062
1063 INIT_LIST_HEAD(&info->modelist);1063 INIT_LIST_HEAD(&info->modelist);
1064 1064
1065 if (pdev->dev.of_node) {1065 if (!pdev->dev.of_node) {
1066 ret = atmel_lcdfb_of_init(sinfo);
1067 if (ret)
1068 goto free_info;
1069 } else {
1070 dev_err(dev, "cannot get default configuration\n");1066 dev_err(dev, "cannot get default configuration\n");
1071 goto free_info;1067 goto free_info;
1072 }1068 }
1073 1069
1070 ret = atmel_lcdfb_of_init(sinfo);
1071 if (ret)
1072 goto free_info;
1073
1074 ret = -ENODEV;
1074 if (!sinfo->config)1075 if (!sinfo->config)
1075 goto free_info;1076 goto free_info;
1076 1077
drivers/video/fbdev/aty/aty128fb.c+6−4
@@ -952,7 +952,7 @@ static void aty128_timings(struct aty128fb_par *par) · 951 unmodified lines
952 u32 x_mpll_ref_fb_div;952 u32 x_mpll_ref_fb_div;
953 u32 xclk_cntl;953 u32 xclk_cntl;
954 u32 Nx, M;954 u32 Nx, M;
955 unsigned PostDivSet[] = { 0, 1, 2, 4, 8, 3, 6, 12 };955 static const unsigned int PostDivSet[] = { 0, 1, 2, 4, 8, 3, 6, 12 };
956#endif956#endif
957 957
958 if (!par->constants.ref_clk)958 if (!par->constants.ref_clk)
@@ -1321,8 +1321,10 @@ static void aty128_set_pll(struct aty128_pll *pll, · 362 unmodified lines
1321{1321{
1322 u32 div3;1322 u32 div3;
1323 1323
1324 unsigned char post_conv[] = /* register values for post dividers */1324 /* register values for post dividers */
1325 { 2, 0, 1, 4, 2, 2, 6, 2, 3, 2, 2, 2, 7 };1325 static const unsigned char post_conv[] = {
1326 2, 0, 1, 4, 2, 2, 6, 2, 3, 2, 2, 2, 7
1327 };
1326 1328
1327 /* select PPLL_DIV_3 */1329 /* select PPLL_DIV_3 */
1328 aty_st_le32(CLOCK_CNTL_INDEX, aty_ld_le32(CLOCK_CNTL_INDEX) | (3 << 8));1330 aty_st_le32(CLOCK_CNTL_INDEX, aty_ld_le32(CLOCK_CNTL_INDEX) | (3 << 8));
@@ -1360,7 +1362,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, · 31 unmodified lines
1360 const struct aty128fb_par *par)1362 const struct aty128fb_par *par)
1361{1363{
1362 const struct aty128_constants c = par->constants;1364 const struct aty128_constants c = par->constants;
1363 unsigned char post_dividers[] = {1,2,4,8,3,6,12};1365 static const unsigned char post_dividers[] = { 1, 2, 4, 8, 3, 6, 12 };
1364 u32 output_freq;1366 u32 output_freq;
1365 u32 vclk; /* in .01 MHz */1367 u32 vclk; /* in .01 MHz */
1366 int i = 0;1368 int i = 0;
drivers/video/fbdev/aty/mach64_ct.c+1−3
@@ -22,13 +22,11 @@ static u32 aty_pll_to_var_ct(const struct fb_info *info, const union aty_pll *pl · 21 unmodified lines
22 22
23u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par)23u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par)
24{24{
25 u8 res;
26 25
27 /* write addr byte */26 /* write addr byte */
28 aty_st_8(CLOCK_CNTL_ADDR, (offset << 2) & PLL_ADDR, par);27 aty_st_8(CLOCK_CNTL_ADDR, (offset << 2) & PLL_ADDR, par);
29 /* read the register value */28 /* read the register value */
30 res = aty_ld_8(CLOCK_CNTL_DATA, par);29 return aty_ld_8(CLOCK_CNTL_DATA, par);
31 return res;
32}30}
33 31
34static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)32static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)
drivers/video/fbdev/aty/mach64_gx.c+0−2
@@ -352,10 +352,8 @@ static int aty_var_to_pll_18818(const struct fb_info *info, u32 vclk_per, · 351 unmodified lines
352 post_divider = 1;352 post_divider = 1;
353 353
354 if (MHz100 > MAX_FREQ_2595) {354 if (MHz100 > MAX_FREQ_2595) {
355 MHz100 = MAX_FREQ_2595;
356 return -EINVAL;355 return -EINVAL;
357 } else if (MHz100 < ABS_MIN_FREQ_2595) {356 } else if (MHz100 < ABS_MIN_FREQ_2595) {
358 program_bits = 0; /* MHz100 = 257 */
359 return -EINVAL;357 return -EINVAL;
360 } else {358 } else {
361 while (MHz100 < MIN_FREQ_2595) {359 while (MHz100 < MIN_FREQ_2595) {
drivers/video/fbdev/au1100fb.c+1−1
@@ -239,7 +239,7 @@ int au1100fb_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned · 238 unmodified lines
239 u32 value;239 u32 value;
240 240
241 fbdev = to_au1100fb_device(fbi);241 fbdev = to_au1100fb_device(fbi);
242 palette = fbdev->regs->lcd_pallettebase;242 palette = fbdev->regs->lcd_palettebase;
243 243
244 if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1))244 if (regno > (AU1100_LCD_NBR_PALETTE_ENTRIES - 1))
245 return -EINVAL;245 return -EINVAL;
drivers/video/fbdev/au1100fb.h+1−1
@@ -92,7 +92,7 @@ struct au1100fb_regs · 91 unmodified lines
92 u32 lcd_pwmdiv;92 u32 lcd_pwmdiv;
93 u32 lcd_pwmhi;93 u32 lcd_pwmhi;
94 u32 reserved[(0x0400-0x002C)/4];94 u32 reserved[(0x0400-0x002C)/4];
95 u32 lcd_pallettebase[256];95 u32 lcd_palettebase[256];
96};96};
97 97
98struct au1100fb_device {98struct au1100fb_device {
drivers/video/fbdev/au1200fb.c+2−2
@@ -1233,8 +1233,8 @@ static int au1200fb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma) · 1232 unmodified lines
1233{1233{
1234 struct au1200fb_device *fbdev = info->par;1234 struct au1200fb_device *fbdev = info->par;
1235 1235
1236 return dma_mmap_attrs(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys,1236 return dma_mmap_coherent(fbdev->dev, vma,
1237 fbdev->fb_len, 0);1237 fbdev->fb_mem, fbdev->fb_phys, fbdev->fb_len);
1238}1238}
1239 1239
1240static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)1240static void set_global(u_int cmd, struct au1200_lcd_global_regs_t *pdata)
drivers/video/fbdev/cirrusfb.c+8−8
@@ -469,7 +469,7 @@ static int cirrusfb_check_mclk(struct fb_info *info, long freq) · 468 unmodified lines
469 return 0;469 return 0;
470}470}
471 471
472static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var,472static int cirrusfb_check_pixclock(struct fb_var_screeninfo *var,
473 struct fb_info *info)473 struct fb_info *info)
474{474{
475 long freq;475 long freq;
@@ -478,9 +478,7 @@ static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var, · 2 unmodified lines
478 unsigned maxclockidx = var->bits_per_pixel >> 3;478 unsigned maxclockidx = var->bits_per_pixel >> 3;
479 479
480 /* convert from ps to kHz */480 /* convert from ps to kHz */
481 freq = PICOS2KHZ(var->pixclock);481 freq = PICOS2KHZ(var->pixclock ? : 1);
482
483 dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq);
484 482
485 maxclock = cirrusfb_board_info[cinfo->btype].maxclock[maxclockidx];483 maxclock = cirrusfb_board_info[cinfo->btype].maxclock[maxclockidx];
486 cinfo->multiplexing = 0;484 cinfo->multiplexing = 0;
@@ -488,11 +486,13 @@ static int cirrusfb_check_pixclock(const struct fb_var_screeninfo *var, · 1 unmodified line
488 /* If the frequency is greater than we can support, we might be able486 /* If the frequency is greater than we can support, we might be able
489 * to use multiplexing for the video mode */487 * to use multiplexing for the video mode */
490 if (freq > maxclock) {488 if (freq > maxclock) {
491 dev_err(info->device,489 var->pixclock = KHZ2PICOS(maxclock);
492 "Frequency greater than maxclock (%ld kHz)\n",490
493 maxclock);491 while ((freq = PICOS2KHZ(var->pixclock)) > maxclock)
494 return -EINVAL;492 var->pixclock++;
495 }493 }
494 dev_dbg(info->device, "desired pixclock: %ld kHz\n", freq);
495
496 /*496 /*
497 * Additional constraint: 8bpp uses DAC clock doubling to allow maximum497 * Additional constraint: 8bpp uses DAC clock doubling to allow maximum
498 * pixel clock498 * pixel clock
drivers/video/fbdev/controlfb.c+2−0
@@ -67,7 +67,9 @@ · 66 unmodified lines
67#define out_8(addr, val) (void)(val)67#define out_8(addr, val) (void)(val)
68#define in_le32(addr) 068#define in_le32(addr) 0
69#define out_le32(addr, val) (void)(val)69#define out_le32(addr, val) (void)(val)
70#ifndef pgprot_cached_wthru
70#define pgprot_cached_wthru(prot) (prot)71#define pgprot_cached_wthru(prot) (prot)
72#endif
71#else73#else
72static void invalid_vram_cache(void __force *addr)74static void invalid_vram_cache(void __force *addr)
73{75{
drivers/video/fbdev/core/fbcvt.c+21−32
@@ -214,9 +214,11 @@ static u32 fb_cvt_aspect_ratio(struct fb_cvt_data *cvt) · 213 unmodified lines
214static void fb_cvt_print_name(struct fb_cvt_data *cvt)214static void fb_cvt_print_name(struct fb_cvt_data *cvt)
215{215{
216 u32 pixcount, pixcount_mod;216 u32 pixcount, pixcount_mod;
217 int cnt = 255, offset = 0, read = 0;217 int size = 256;
218 u8 *buf = kzalloc(256, GFP_KERNEL);218 int off = 0;
219 u8 *buf;
219 220
221 buf = kzalloc(size, GFP_KERNEL);
220 if (!buf)222 if (!buf)
221 return;223 return;
222 224
@@ -224,43 +226,30 @@ static void fb_cvt_print_name(struct fb_cvt_data *cvt) · 1 unmodified line
224 pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000;226 pixcount_mod = (cvt->xres * (cvt->yres/cvt->interlace)) % 1000000;
225 pixcount_mod /= 1000;227 pixcount_mod /= 1000;
226 228
227 read = snprintf(buf+offset, cnt, "fbcvt: %dx%d@%d: CVT Name - ",229 off += scnprintf(buf + off, size - off, "fbcvt: %dx%d@%d: CVT Name - ",
228 cvt->xres, cvt->yres, cvt->refresh);230 cvt->xres, cvt->yres, cvt->refresh);
229 offset += read;
230 cnt -= read;
231 231
232 if (cvt->status)232 if (cvt->status) {
233 snprintf(buf+offset, cnt, "Not a CVT standard - %d.%03d Mega "233 off += scnprintf(buf + off, size - off,
234 "Pixel Image\n", pixcount, pixcount_mod);234 "Not a CVT standard - %d.%03d Mega Pixel Image\n",
235 else {235 pixcount, pixcount_mod);
236 if (pixcount) {236 } else {
237 read = snprintf(buf+offset, cnt, "%d", pixcount);237 if (pixcount)
238 cnt -= read;238 off += scnprintf(buf + off, size - off, "%d", pixcount);
239 offset += read;
240 }
241 239
242 read = snprintf(buf+offset, cnt, ".%03dM", pixcount_mod);240 off += scnprintf(buf + off, size - off, ".%03dM", pixcount_mod);
243 cnt -= read;
244 offset += read;
245 241
246 if (cvt->aspect_ratio == 0)242 if (cvt->aspect_ratio == 0)
247 read = snprintf(buf+offset, cnt, "3");243 off += scnprintf(buf + off, size - off, "3");
248 else if (cvt->aspect_ratio == 3)244 else if (cvt->aspect_ratio == 3)
249 read = snprintf(buf+offset, cnt, "4");245 off += scnprintf(buf + off, size - off, "4");
250 else if (cvt->aspect_ratio == 1 || cvt->aspect_ratio == 4)246 else if (cvt->aspect_ratio == 1 || cvt->aspect_ratio == 4)
251 read = snprintf(buf+offset, cnt, "9");247 off += scnprintf(buf + off, size - off, "9");
252 else if (cvt->aspect_ratio == 2)248 else if (cvt->aspect_ratio == 2)
253 read = snprintf(buf+offset, cnt, "A");249 off += scnprintf(buf + off, size - off, "A");
254 else250
255 read = 0;251 if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK)
256 cnt -= read;252 off += scnprintf(buf + off, size - off, "-R");
257 offset += read;
258
259 if (cvt->flags & FB_CVT_FLAG_REDUCED_BLANK) {
260 read = snprintf(buf+offset, cnt, "-R");
261 cnt -= read;
262 offset += read;
263 }
264 }253 }
265 254
266 printk(KERN_INFO "%s\n", buf);255 printk(KERN_INFO "%s\n", buf);
drivers/video/fbdev/core/fbmem.c+2−6
@@ -396,18 +396,14 @@ static void fb_rotate_logo(struct fb_info *info, u8 *dst, · 395 unmodified lines
396 } else if (rotate == FB_ROTATE_CW) {396 } else if (rotate == FB_ROTATE_CW) {
397 fb_rotate_logo_cw(image->data, dst, image->width,397 fb_rotate_logo_cw(image->data, dst, image->width,
398 image->height);398 image->height);
399 tmp = image->width;399 swap(image->width, image->height);
400 image->width = image->height;
401 image->height = tmp;
402 tmp = image->dy;400 tmp = image->dy;
403 image->dy = image->dx;401 image->dy = image->dx;
404 image->dx = info->var.xres - image->width - tmp;402 image->dx = info->var.xres - image->width - tmp;
405 } else if (rotate == FB_ROTATE_CCW) {403 } else if (rotate == FB_ROTATE_CCW) {
406 fb_rotate_logo_ccw(image->data, dst, image->width,404 fb_rotate_logo_ccw(image->data, dst, image->width,
407 image->height);405 image->height);
408 tmp = image->width;406 swap(image->width, image->height);
409 image->width = image->height;
410 image->height = tmp;
411 tmp = image->dx;407 tmp = image->dx;
412 image->dx = image->dy;408 image->dx = image->dy;
413 image->dy = info->var.yres - image->height - tmp;409 image->dy = info->var.yres - image->height - tmp;
drivers/video/fbdev/da8xx-fb.c+3−4
@@ -1354,10 +1354,9 @@ static int fb_probe(struct platform_device *device) · 1353 unmodified lines
1354 return PTR_ERR(da8xx_fb_reg_base);1354 return PTR_ERR(da8xx_fb_reg_base);
1355 1355
1356 tmp_lcdc_clk = devm_clk_get(&device->dev, "fck");1356 tmp_lcdc_clk = devm_clk_get(&device->dev, "fck");
1357 if (IS_ERR(tmp_lcdc_clk)) {1357 if (IS_ERR(tmp_lcdc_clk))
1358 dev_err(&device->dev, "Can not get device clock\n");1358 return dev_err_probe(&device->dev, PTR_ERR(tmp_lcdc_clk),
1359 return PTR_ERR(tmp_lcdc_clk);1359 "Can not get device clock\n");
1360 }
1361 1360
1362 pm_runtime_enable(&device->dev);1361 pm_runtime_enable(&device->dev);
1363 pm_runtime_get_sync(&device->dev);1362 pm_runtime_get_sync(&device->dev);
drivers/video/fbdev/imxfb.c+2−0
@@ -1083,6 +1083,8 @@ static int imxfb_remove(struct platform_device *pdev) · 1082 unmodified lines
1083 struct resource *res;1083 struct resource *res;
1084 1084
1085 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);1085 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1086 if (!res)
1087 return -EINVAL;
1086 1088
1087 imxfb_disable_controller(fbi);1089 imxfb_disable_controller(fbi);
1088 1090
drivers/video/fbdev/kyro/STG4000InitDevice.c+1−1
@@ -124,7 +124,7 @@ u32 ProgramClock(u32 refClock, · 123 unmodified lines
124 u32 ulScore, ulPhaseScore, ulVcoScore;124 u32 ulScore, ulPhaseScore, ulVcoScore;
125 u32 ulTmp = 0, ulVCO;125 u32 ulTmp = 0, ulVCO;
126 u32 ulScaleClockReq, ulMinClock, ulMaxClock;126 u32 ulScaleClockReq, ulMinClock, ulMaxClock;
127 u32 ODValues[] = { 1, 2, 0 };127 static const unsigned char ODValues[] = { 1, 2, 0 };
128 128
129 /* Translate clock in Hz */129 /* Translate clock in Hz */
130 coreClock *= 100; /* in Hz */130 coreClock *= 100; /* in Hz */
drivers/video/fbdev/matrox/matroxfb_base.c+1−1
@@ -1377,7 +1377,7 @@ static struct video_board vbG200 = { · 1376 unmodified lines
1377 .lowlevel = &matrox_G1001377 .lowlevel = &matrox_G100
1378};1378};
1379static struct video_board vbG200eW = {1379static struct video_board vbG200eW = {
1380 .maxvram = 0x800000,1380 .maxvram = 0x100000,
1381 .maxdisplayable = 0x800000,1381 .maxdisplayable = 0x800000,
1382 .accelID = FB_ACCEL_MATROX_MGAG200,1382 .accelID = FB_ACCEL_MATROX_MGAG200,
1383 .lowlevel = &matrox_G1001383 .lowlevel = &matrox_G100
drivers/video/fbdev/mb862xx/mb862xxfb_accel.c+1−1
@@ -132,7 +132,7 @@ static void mb86290fb_imageblit8(u32 *cmd, u16 step, u16 dx, u16 dy, · 131 unmodified lines
132 cmd[2] = (height << 16) | width;132 cmd[2] = (height << 16) | width;
133 133
134 i = 0;134 i = 0;
135 line = ptr = image->data;135 line = image->data;
136 bytes = image->width;136 bytes = image->width;
137 137
138 while (i < height) {138 while (i < height) {
drivers/video/fbdev/mmp/hw/mmp_ctrl.c+2−1
@@ -514,7 +514,8 @@ static int mmphw_probe(struct platform_device *pdev) · 513 unmodified lines
514 /* get clock */514 /* get clock */
515 ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name);515 ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name);
516 if (IS_ERR(ctrl->clk)) {516 if (IS_ERR(ctrl->clk)) {
517 dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name);517 dev_err_probe(ctrl->dev, ret,
518 "unable to get clk %s\n", mi->clk_name);
518 ret = -ENOENT;519 ret = -ENOENT;
519 goto failed;520 goto failed;
520 }521 }
drivers/video/fbdev/nvidia/nv_i2c.c+1−1
@@ -86,7 +86,7 @@ static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name, · 85 unmodified lines
86{86{
87 int rc;87 int rc;
88 88
89 strcpy(chan->adapter.name, name);89 strscpy(chan->adapter.name, name, sizeof(chan->adapter.name));
90 chan->adapter.owner = THIS_MODULE;90 chan->adapter.owner = THIS_MODULE;
91 chan->adapter.class = i2c_class;91 chan->adapter.class = i2c_class;
92 chan->adapter.algo_data = &chan->algo;92 chan->adapter.algo_data = &chan->algo;
drivers/video/fbdev/ocfb.c+1−1
@@ -387,7 +387,7 @@ static int ocfb_remove(struct platform_device *pdev) · 386 unmodified lines
387 return 0;387 return 0;
388}388}
389 389
390static struct of_device_id ocfb_match[] = {390static const struct of_device_id ocfb_match[] = {
391 { .compatible = "opencores,ocfb", },391 { .compatible = "opencores,ocfb", },
392 {},392 {},
393};393};
drivers/video/fbdev/offb.c+1−1
@@ -412,7 +412,7 @@ static void __init offb_init_fb(const char *name, · 411 unmodified lines
412 412
413 info = framebuffer_alloc(sizeof(u32) * 16, NULL);413 info = framebuffer_alloc(sizeof(u32) * 16, NULL);
414 414
415 if (info == 0) {415 if (!info) {
416 release_mem_region(res_start, res_size);416 release_mem_region(res_start, res_size);
417 return;417 return;
418 }418 }
drivers/video/fbdev/omap/lcd_ams_delta.c+6−10
@@ -131,18 +131,14 @@ static int ams_delta_panel_probe(struct platform_device *pdev) · 130 unmodified lines
131 int ret;131 int ret;
132 132
133 gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW);133 gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW);
134 if (IS_ERR(gpiod_vblen)) {134 if (IS_ERR(gpiod_vblen))
135 ret = PTR_ERR(gpiod_vblen);135 return dev_err_probe(&pdev->dev, PTR_ERR(gpiod_vblen),
136 dev_err(&pdev->dev, "VBLEN GPIO request failed (%d)\n", ret);136 "VBLEN GPIO request failed\n");
137 return ret;
138 }
139 137
140 gpiod_ndisp = devm_gpiod_get(&pdev->dev, "ndisp", GPIOD_OUT_LOW);138 gpiod_ndisp = devm_gpiod_get(&pdev->dev, "ndisp", GPIOD_OUT_LOW);
141 if (IS_ERR(gpiod_ndisp)) {139 if (IS_ERR(gpiod_ndisp))
142 ret = PTR_ERR(gpiod_ndisp);140 return dev_err_probe(&pdev->dev, PTR_ERR(gpiod_ndisp),
143 dev_err(&pdev->dev, "NDISP GPIO request failed (%d)\n", ret);141 "NDISP GPIO request failed\n");
144 return ret;
145 }
146 142
147#ifdef CONFIG_LCD_CLASS_DEVICE143#ifdef CONFIG_LCD_CLASS_DEVICE
148 lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL,144 lcd_device = lcd_device_register("omapfb", &pdev->dev, NULL,
drivers/video/fbdev/omap/omapfb_main.c+7−6
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/slab.h>16#include <linux/slab.h>
17#include <linux/uaccess.h>17#include <linux/uaccess.h>
18#include <linux/module.h>18#include <linux/module.h>
19#include <linux/sysfs.h>
19 20
20#include <linux/omap-dma.h>21#include <linux/omap-dma.h>
21 22
@@ -1303,7 +1304,7 @@ static ssize_t omapfb_show_panel_name(struct device *dev, · 1281 unmodified lines
1303{1304{
1304 struct omapfb_device *fbdev = dev_get_drvdata(dev);1305 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1305 1306
1306 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->panel->name);1307 return sysfs_emit(buf, "%s\n", fbdev->panel->name);
1307}1308}
1308 1309
1309static ssize_t omapfb_show_bklight_level(struct device *dev,1310static ssize_t omapfb_show_bklight_level(struct device *dev,
@@ -1314,8 +1315,8 @@ static ssize_t omapfb_show_bklight_level(struct device *dev, · 4 unmodified lines
1314 int r;1315 int r;
1315 1316
1316 if (fbdev->panel->get_bklight_level) {1317 if (fbdev->panel->get_bklight_level) {
1317 r = snprintf(buf, PAGE_SIZE, "%d\n",1318 r = sysfs_emit(buf, "%d\n",
1318 fbdev->panel->get_bklight_level(fbdev->panel));1319 fbdev->panel->get_bklight_level(fbdev->panel));
1319 } else1320 } else
1320 r = -ENODEV;1321 r = -ENODEV;
1321 return r;1322 return r;
@@ -1348,8 +1349,8 @@ static ssize_t omapfb_show_bklight_max(struct device *dev, · 26 unmodified lines
1348 int r;1349 int r;
1349 1350
1350 if (fbdev->panel->get_bklight_level) {1351 if (fbdev->panel->get_bklight_level) {
1351 r = snprintf(buf, PAGE_SIZE, "%d\n",1352 r = sysfs_emit(buf, "%d\n",
1352 fbdev->panel->get_bklight_max(fbdev->panel));1353 fbdev->panel->get_bklight_max(fbdev->panel));
1353 } else1354 } else
1354 r = -ENODEV;1355 r = -ENODEV;
1355 return r;1356 return r;
@@ -1379,7 +1380,7 @@ static ssize_t omapfb_show_ctrl_name(struct device *dev, · 23 unmodified lines
1379{1380{
1380 struct omapfb_device *fbdev = dev_get_drvdata(dev);1381 struct omapfb_device *fbdev = dev_get_drvdata(dev);
1381 1382
1382 return snprintf(buf, PAGE_SIZE, "%s\n", fbdev->ctrl->name);1383 return sysfs_emit(buf, "%s\n", fbdev->ctrl->name);
1383}1384}
1384 1385
1385static struct device_attribute dev_attr_ctrl_name =1386static struct device_attribute dev_attr_ctrl_name =
drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c+1−0
@@ -246,6 +246,7 @@ static int dvic_probe_of(struct platform_device *pdev) · 245 unmodified lines
246 adapter_node = of_parse_phandle(node, "ddc-i2c-bus", 0);246 adapter_node = of_parse_phandle(node, "ddc-i2c-bus", 0);
247 if (adapter_node) {247 if (adapter_node) {
248 adapter = of_get_i2c_adapter_by_node(adapter_node);248 adapter = of_get_i2c_adapter_by_node(adapter_node);
249 of_node_put(adapter_node);
249 if (adapter == NULL) {250 if (adapter == NULL) {
250 dev_err(&pdev->dev, "failed to parse ddc-i2c-bus\n");251 dev_err(&pdev->dev, "failed to parse ddc-i2c-bus\n");
251 omap_dss_put_device(ddata->in);252 omap_dss_put_device(ddata->in);
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c+4−4
@@ -409,7 +409,7 @@ static ssize_t dsicm_num_errors_show(struct device *dev, · 408 unmodified lines
409 if (r)409 if (r)
410 return r;410 return r;
411 411
412 return snprintf(buf, PAGE_SIZE, "%d\n", errors);412 return sysfs_emit(buf, "%d\n", errors);
413}413}
414 414
415static ssize_t dsicm_hw_revision_show(struct device *dev,415static ssize_t dsicm_hw_revision_show(struct device *dev,
@@ -439,7 +439,7 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, · 23 unmodified lines
439 if (r)439 if (r)
440 return r;440 return r;
441 441
442 return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3);442 return sysfs_emit(buf, "%02x.%02x.%02x\n", id1, id2, id3);
443}443}
444 444
445static ssize_t dsicm_store_ulps(struct device *dev,445static ssize_t dsicm_store_ulps(struct device *dev,
@@ -487,7 +487,7 @@ static ssize_t dsicm_show_ulps(struct device *dev, · 41 unmodified lines
487 t = ddata->ulps_enabled;487 t = ddata->ulps_enabled;
488 mutex_unlock(&ddata->lock);488 mutex_unlock(&ddata->lock);
489 489
490 return snprintf(buf, PAGE_SIZE, "%u\n", t);490 return sysfs_emit(buf, "%u\n", t);
491}491}
492 492
493static ssize_t dsicm_store_ulps_timeout(struct device *dev,493static ssize_t dsicm_store_ulps_timeout(struct device *dev,
@@ -532,7 +532,7 @@ static ssize_t dsicm_show_ulps_timeout(struct device *dev, · 38 unmodified lines
532 t = ddata->ulps_timeout;532 t = ddata->ulps_timeout;
533 mutex_unlock(&ddata->lock);533 mutex_unlock(&ddata->lock);
534 534
535 return snprintf(buf, PAGE_SIZE, "%u\n", t);535 return sysfs_emit(buf, "%u\n", t);
536}536}
537 537
538static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL);538static DEVICE_ATTR(num_dsi_errors, S_IRUGO, dsicm_num_errors_show, NULL);
drivers/video/fbdev/omap2/omapfb/displays/panel-lgphilips-lb035q02.c+3−4
@@ -244,10 +244,9 @@ static int lb035q02_probe_of(struct spi_device *spi) · 243 unmodified lines
244 struct gpio_desc *gpio;244 struct gpio_desc *gpio;
245 245
246 gpio = devm_gpiod_get(&spi->dev, "enable", GPIOD_OUT_LOW);246 gpio = devm_gpiod_get(&spi->dev, "enable", GPIOD_OUT_LOW);
247 if (IS_ERR(gpio)) {247 if (IS_ERR(gpio))
248 dev_err(&spi->dev, "failed to parse enable gpio\n");248 return dev_err_probe(&spi->dev, PTR_ERR(gpio),
249 return PTR_ERR(gpio);249 "failed to parse enable gpio\n");
250 }
251 250
252 ddata->enable_gpio = gpio;251 ddata->enable_gpio = gpio;
253 252
drivers/video/fbdev/omap2/omapfb/displays/panel-sharp-ls037v7dw01.c+3−4
@@ -211,10 +211,9 @@ static int sharp_ls_probe_of(struct platform_device *pdev) · 210 unmodified lines
211 int r;211 int r;
212 212
213 ddata->vcc = devm_regulator_get(&pdev->dev, "envdd");213 ddata->vcc = devm_regulator_get(&pdev->dev, "envdd");
214 if (IS_ERR(ddata->vcc)) {214 if (IS_ERR(ddata->vcc))
215 dev_err(&pdev->dev, "failed to get regulator\n");215 return dev_err_probe(&pdev->dev, PTR_ERR(ddata->vcc),
216 return PTR_ERR(ddata->vcc);216 "failed to get regulator\n");
217 }
218 217
219 /* lcd INI */218 /* lcd INI */
220 r = sharp_ls_get_gpio_of(&pdev->dev, 0, 0, "enable", &ddata->ini_gpio);219 r = sharp_ls_get_gpio_of(&pdev->dev, 0, 0, "enable", &ddata->ini_gpio);
drivers/video/fbdev/omap2/omapfb/displays/panel-sony-acx565akm.c+1−1
@@ -476,7 +476,7 @@ static ssize_t show_cabc_available_modes(struct device *dev, · 475 unmodified lines
476 int i;476 int i;
477 477
478 if (!ddata->has_cabc)478 if (!ddata->has_cabc)
479 return snprintf(buf, PAGE_SIZE, "%s\n", cabc_modes[0]);479 return sysfs_emit(buf, "%s\n", cabc_modes[0]);
480 480
481 for (i = 0, len = 0;481 for (i = 0, len = 0;
482 len < PAGE_SIZE && i < ARRAY_SIZE(cabc_modes); i++)482 len < PAGE_SIZE && i < ARRAY_SIZE(cabc_modes); i++)
drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c+3−4
@@ -169,7 +169,7 @@ static ssize_t tpo_td043_vmirror_show(struct device *dev, · 168 unmodified lines
169{169{
170 struct panel_drv_data *ddata = dev_get_drvdata(dev);170 struct panel_drv_data *ddata = dev_get_drvdata(dev);
171 171
172 return snprintf(buf, PAGE_SIZE, "%d\n", ddata->vmirror);172 return sysfs_emit(buf, "%d\n", ddata->vmirror);
173}173}
174 174
175static ssize_t tpo_td043_vmirror_store(struct device *dev,175static ssize_t tpo_td043_vmirror_store(struct device *dev,
@@ -199,7 +199,7 @@ static ssize_t tpo_td043_mode_show(struct device *dev, · 23 unmodified lines
199{199{
200 struct panel_drv_data *ddata = dev_get_drvdata(dev);200 struct panel_drv_data *ddata = dev_get_drvdata(dev);
201 201
202 return snprintf(buf, PAGE_SIZE, "%d\n", ddata->mode);202 return sysfs_emit(buf, "%d\n", ddata->mode);
203}203}
204 204
205static ssize_t tpo_td043_mode_store(struct device *dev,205static ssize_t tpo_td043_mode_store(struct device *dev,
@@ -517,8 +517,7 @@ static int tpo_td043_probe(struct spi_device *spi) · 311 unmodified lines
517 517
518 ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");518 ddata->vcc_reg = devm_regulator_get(&spi->dev, "vcc");
519 if (IS_ERR(ddata->vcc_reg)) {519 if (IS_ERR(ddata->vcc_reg)) {
520 dev_err(&spi->dev, "failed to get LCD VCC regulator\n");520 r = dev_err_probe(&spi->dev, r, "failed to get LCD VCC regulator\n");
521 r = PTR_ERR(ddata->vcc_reg);
522 goto err_regulator;521 goto err_regulator;
523 }522 }
524 523
drivers/video/fbdev/omap2/omapfb/dss/display-sysfs.c+2−1
@@ -265,6 +265,7 @@ static struct attribute *display_sysfs_attrs[] = { · 264 unmodified lines
265 &display_attr_wss.attr,265 &display_attr_wss.attr,
266 NULL266 NULL
267};267};
268ATTRIBUTE_GROUPS(display_sysfs);
268 269
269static ssize_t display_attr_show(struct kobject *kobj, struct attribute *attr,270static ssize_t display_attr_show(struct kobject *kobj, struct attribute *attr,
270 char *buf)271 char *buf)
@@ -303,7 +304,7 @@ static const struct sysfs_ops display_sysfs_ops = { · 32 unmodified lines
303 304
304static struct kobj_type display_ktype = {305static struct kobj_type display_ktype = {
305 .sysfs_ops = &display_sysfs_ops,306 .sysfs_ops = &display_sysfs_ops,
306 .default_attrs = display_sysfs_attrs,307 .default_groups = display_sysfs_groups,
307};308};
308 309
309int display_init_sysfs(struct platform_device *pdev)310int display_init_sysfs(struct platform_device *pdev)
drivers/video/fbdev/omap2/omapfb/dss/manager-sysfs.c+2−1
@@ -457,6 +457,7 @@ static struct attribute *manager_sysfs_attrs[] = { · 456 unmodified lines
457 &manager_attr_cpr_coef.attr,457 &manager_attr_cpr_coef.attr,
458 NULL458 NULL
459};459};
460ATTRIBUTE_GROUPS(manager_sysfs);
460 461
461static ssize_t manager_attr_show(struct kobject *kobj, struct attribute *attr,462static ssize_t manager_attr_show(struct kobject *kobj, struct attribute *attr,
462 char *buf)463 char *buf)
@@ -495,7 +496,7 @@ static const struct sysfs_ops manager_sysfs_ops = { · 32 unmodified lines
495 496
496static struct kobj_type manager_ktype = {497static struct kobj_type manager_ktype = {
497 .sysfs_ops = &manager_sysfs_ops,498 .sysfs_ops = &manager_sysfs_ops,
498 .default_attrs = manager_sysfs_attrs,499 .default_groups = manager_sysfs_groups,
499};500};
500 501
501int dss_manager_kobj_init(struct omap_overlay_manager *mgr,502int dss_manager_kobj_init(struct omap_overlay_manager *mgr,
drivers/video/fbdev/omap2/omapfb/dss/overlay-sysfs.c+2−1
@@ -390,6 +390,7 @@ static struct attribute *overlay_sysfs_attrs[] = { · 389 unmodified lines
390 &overlay_attr_zorder.attr,390 &overlay_attr_zorder.attr,
391 NULL391 NULL
392};392};
393ATTRIBUTE_GROUPS(overlay_sysfs);
393 394
394static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr,395static ssize_t overlay_attr_show(struct kobject *kobj, struct attribute *attr,
395 char *buf)396 char *buf)
@@ -428,7 +429,7 @@ static const struct sysfs_ops overlay_sysfs_ops = { · 32 unmodified lines
428 429
429static struct kobj_type overlay_ktype = {430static struct kobj_type overlay_ktype = {
430 .sysfs_ops = &overlay_sysfs_ops,431 .sysfs_ops = &overlay_sysfs_ops,
431 .default_attrs = overlay_sysfs_attrs,432 .default_groups = overlay_sysfs_groups,
432};433};
433 434
434int dss_overlay_kobj_init(struct omap_overlay *ovl,435int dss_overlay_kobj_init(struct omap_overlay *ovl,
drivers/video/fbdev/omap2/omapfb/omapfb-main.c+0−1
@@ -1854,7 +1854,6 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev) · 1853 unmodified lines
1854 }1854 }
1855 1855
1856 if (fbdev->auto_update_wq != NULL) {1856 if (fbdev->auto_update_wq != NULL) {
1857 flush_workqueue(fbdev->auto_update_wq);
1858 destroy_workqueue(fbdev->auto_update_wq);1857 destroy_workqueue(fbdev->auto_update_wq);
1859 fbdev->auto_update_wq = NULL;1858 fbdev->auto_update_wq = NULL;
1860 }1859 }
drivers/video/fbdev/pxa168fb.c+6−9
@@ -593,8 +593,8 @@ static void pxa168fb_init_mode(struct fb_info *info, · 592 unmodified lines
593static int pxa168fb_probe(struct platform_device *pdev)593static int pxa168fb_probe(struct platform_device *pdev)
594{594{
595 struct pxa168fb_mach_info *mi;595 struct pxa168fb_mach_info *mi;
596 struct fb_info *info = 0;596 struct fb_info *info = NULL;
597 struct pxa168fb_info *fbi = 0;597 struct pxa168fb_info *fbi = NULL;
598 struct resource *res;598 struct resource *res;
599 struct clk *clk;599 struct clk *clk;
600 int irq, ret;600 int irq, ret;
@@ -606,10 +606,9 @@ static int pxa168fb_probe(struct platform_device *pdev) · 5 unmodified lines
606 }606 }
607 607
608 clk = devm_clk_get(&pdev->dev, "LCDCLK");608 clk = devm_clk_get(&pdev->dev, "LCDCLK");
609 if (IS_ERR(clk)) {609 if (IS_ERR(clk))
610 dev_err(&pdev->dev, "unable to get LCDCLK");610 return dev_err_probe(&pdev->dev, PTR_ERR(clk),
611 return PTR_ERR(clk);611 "unable to get LCDCLK");
612 }
613 612
614 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);613 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
615 if (res == NULL) {614 if (res == NULL) {
@@ -618,10 +617,8 @@ static int pxa168fb_probe(struct platform_device *pdev) · 2 unmodified lines
618 }617 }
619 618
620 irq = platform_get_irq(pdev, 0);619 irq = platform_get_irq(pdev, 0);
621 if (irq < 0) {620 if (irq < 0)
622 dev_err(&pdev->dev, "no IRQ defined\n");
623 return -ENOENT;621 return -ENOENT;
624 }
625 622
626 info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);623 info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
627 if (info == NULL) {624 if (info == NULL) {
drivers/video/fbdev/pxa3xx-gcu.c+3−7
@@ -606,17 +606,13 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) · 605 unmodified lines
606 606
607 /* enable the clock */607 /* enable the clock */
608 priv->clk = devm_clk_get(dev, NULL);608 priv->clk = devm_clk_get(dev, NULL);
609 if (IS_ERR(priv->clk)) {609 if (IS_ERR(priv->clk))
610 dev_err(dev, "failed to get clock\n");610 return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get clock\n");
611 return PTR_ERR(priv->clk);
612 }
613 611
614 /* request the IRQ */612 /* request the IRQ */
615 irq = platform_get_irq(pdev, 0);613 irq = platform_get_irq(pdev, 0);
616 if (irq < 0) {614 if (irq < 0)
617 dev_err(dev, "no IRQ defined: %d\n", irq);
618 return irq;615 return irq;
619 }
620 616
621 ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,617 ret = devm_request_irq(dev, irq, pxa3xx_gcu_handle_irq,
622 0, DRV_NAME, priv);618 0, DRV_NAME, priv);
drivers/video/fbdev/s3c-fb.c+8−12
@@ -1360,7 +1360,6 @@ static int s3c_fb_probe(struct platform_device *pdev) · 1359 unmodified lines
1360 struct device *dev = &pdev->dev;1360 struct device *dev = &pdev->dev;
1361 struct s3c_fb_platdata *pd;1361 struct s3c_fb_platdata *pd;
1362 struct s3c_fb *sfb;1362 struct s3c_fb *sfb;
1363 struct resource *res;
1364 int win;1363 int win;
1365 int ret = 0;1364 int ret = 0;
1366 u32 reg;1365 u32 reg;
@@ -1392,18 +1391,17 @@ static int s3c_fb_probe(struct platform_device *pdev) · 25 unmodified lines
1392 spin_lock_init(&sfb->slock);1391 spin_lock_init(&sfb->slock);
1393 1392
1394 sfb->bus_clk = devm_clk_get(dev, "lcd");1393 sfb->bus_clk = devm_clk_get(dev, "lcd");
1395 if (IS_ERR(sfb->bus_clk)) {1394 if (IS_ERR(sfb->bus_clk))
1396 dev_err(dev, "failed to get bus clock\n");1395 return dev_err_probe(dev, PTR_ERR(sfb->bus_clk),
1397 return PTR_ERR(sfb->bus_clk);1396 "failed to get bus clock\n");
1398 }
1399 1397
1400 clk_prepare_enable(sfb->bus_clk);1398 clk_prepare_enable(sfb->bus_clk);
1401 1399
1402 if (!sfb->variant.has_clksel) {1400 if (!sfb->variant.has_clksel) {
1403 sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd");1401 sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd");
1404 if (IS_ERR(sfb->lcd_clk)) {1402 if (IS_ERR(sfb->lcd_clk)) {
1405 dev_err(dev, "failed to get lcd clock\n");1403 ret = dev_err_probe(dev, PTR_ERR(sfb->lcd_clk),
1406 ret = PTR_ERR(sfb->lcd_clk);1404 "failed to get lcd clock\n");
1407 goto err_bus_clk;1405 goto err_bus_clk;
1408 }1406 }
1409 1407
@@ -1418,13 +1416,12 @@ static int s3c_fb_probe(struct platform_device *pdev) · 8 unmodified lines
1418 goto err_lcd_clk;1416 goto err_lcd_clk;
1419 }1417 }
1420 1418
1421 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);1419 sfb->irq_no = platform_get_irq(pdev, 0);
1422 if (!res) {1420 if (sfb->irq_no < 0) {
1423 dev_err(dev, "failed to acquire irq resource\n");
1424 ret = -ENOENT;1421 ret = -ENOENT;
1425 goto err_lcd_clk;1422 goto err_lcd_clk;
1426 }1423 }
1427 sfb->irq_no = res->start;1424
1428 ret = devm_request_irq(dev, sfb->irq_no, s3c_fb_irq,1425 ret = devm_request_irq(dev, sfb->irq_no, s3c_fb_irq,
1429 0, "s3c_fb", sfb);1426 0, "s3c_fb", sfb);
1430 if (ret) {1427 if (ret) {
@@ -1810,4 +1807,3 @@ module_platform_driver(s3c_fb_driver); · 379 unmodified lines
1810MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");1807MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
1811MODULE_DESCRIPTION("Samsung S3C SoC Framebuffer driver");1808MODULE_DESCRIPTION("Samsung S3C SoC Framebuffer driver");
1812MODULE_LICENSE("GPL");1809MODULE_LICENSE("GPL");
1813MODULE_ALIAS("platform:s3c-fb");
drivers/video/fbdev/savage/savagefb.h+0−1
@@ -195,7 +195,6 @@ struct savagefb_par { · 194 unmodified lines
195 struct savage_reg initial;195 struct savage_reg initial;
196 struct vgastate vgastate;196 struct vgastate vgastate;
197 struct mutex open_lock;197 struct mutex open_lock;
198 unsigned char *edid;
199 u32 pseudo_palette[16];198 u32 pseudo_palette[16];
200 u32 open_count;199 u32 open_count;
201 int paletteEnabled;200 int paletteEnabled;
drivers/video/fbdev/savage/savagefb_driver.c+4−3
@@ -2170,6 +2170,7 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id) · 2169 unmodified lines
2170 struct fb_info *info;2170 struct fb_info *info;
2171 struct savagefb_par *par;2171 struct savagefb_par *par;
2172 u_int h_sync, v_sync;2172 u_int h_sync, v_sync;
2173 unsigned char __maybe_unused *edid;
2173 int err, lpitch;2174 int err, lpitch;
2174 int video_len;2175 int video_len;
2175 2176
@@ -2212,9 +2213,9 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id) · 36 unmodified lines
2212 INIT_LIST_HEAD(&info->modelist);2213 INIT_LIST_HEAD(&info->modelist);
2213#if defined(CONFIG_FB_SAVAGE_I2C)2214#if defined(CONFIG_FB_SAVAGE_I2C)
2214 savagefb_create_i2c_busses(info);2215 savagefb_create_i2c_busses(info);
2215 savagefb_probe_i2c_connector(info, &par->edid);2216 savagefb_probe_i2c_connector(info, &edid);
2216 fb_edid_to_monspecs(par->edid, &info->monspecs);2217 fb_edid_to_monspecs(edid, &info->monspecs);
2217 kfree(par->edid);2218 kfree(edid);
2218 fb_videomode_to_modelist(info->monspecs.modedb,2219 fb_videomode_to_modelist(info->monspecs.modedb,
2219 info->monspecs.modedb_len,2220 info->monspecs.modedb_len,
2220 &info->modelist);2221 &info->modelist);
drivers/video/fbdev/sis/sis_main.c+1−1
@@ -213,7 +213,7 @@ static void sisfb_search_mode(char *name, bool quiet) · 212 unmodified lines
213 /* This does some fuzzy mode naming detection */213 /* This does some fuzzy mode naming detection */
214 if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) == 4) {214 if(sscanf(strbuf1, "%u %u %u %u", &xres, &yres, &depth, &rate) == 4) {
215 if((rate <= 32) || (depth > 32)) {215 if((rate <= 32) || (depth > 32)) {
216 j = rate; rate = depth; depth = j;216 swap(rate, depth);
217 }217 }
218 sprintf(strbuf, "%ux%ux%u", xres, yres, depth);218 sprintf(strbuf, "%ux%ux%u", xres, yres, depth);
219 nameptr = strbuf;219 nameptr = strbuf;
drivers/video/fbdev/sm712fb.c+11−35
@@ -1047,7 +1047,7 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, · 1046 unmodified lines
1047 if (count + p > total_size)1047 if (count + p > total_size)
1048 count = total_size - p;1048 count = total_size - p;
1049 1049
1050 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);1050 buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
1051 if (!buffer)1051 if (!buffer)
1052 return -ENOMEM;1052 return -ENOMEM;
1053 1053
@@ -1059,25 +1059,14 @@ static ssize_t smtcfb_read(struct fb_info *info, char __user *buf, · 5 unmodified lines
1059 while (count) {1059 while (count) {
1060 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;1060 c = (count > PAGE_SIZE) ? PAGE_SIZE : count;
1061 dst = buffer;1061 dst = buffer;
1062 for (i = c >> 2; i--;) {1062 for (i = (c + 3) >> 2; i--;) {
1063 *dst = fb_readl(src++);1063 u32 val;
1064 *dst = big_swap(*dst);1064
1065 val = fb_readl(src);
1066 *dst = big_swap(val);
1067 src++;
1065 dst++;1068 dst++;
1066 }1069 }
1067 if (c & 3) {
1068 u8 *dst8 = (u8 *)dst;
1069 u8 __iomem *src8 = (u8 __iomem *)src;
1070
1071 for (i = c & 3; i--;) {
1072 if (i & 1) {
1073 *dst8++ = fb_readb(++src8);
1074 } else {
1075 *dst8++ = fb_readb(--src8);
1076 src8 += 2;
1077 }
1078 }
1079 src = (u32 __iomem *)src8;
1080 }
1081 1070
1082 if (copy_to_user(buf, buffer, c)) {1071 if (copy_to_user(buf, buffer, c)) {
1083 err = -EFAULT;1072 err = -EFAULT;
@@ -1130,7 +1119,7 @@ static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, · 46 unmodified lines
1130 count = total_size - p;1119 count = total_size - p;
1131 }1120 }
1132 1121
1133 buffer = kmalloc((count > PAGE_SIZE) ? PAGE_SIZE : count, GFP_KERNEL);1122 buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
1134 if (!buffer)1123 if (!buffer)
1135 return -ENOMEM;1124 return -ENOMEM;
1136 1125
@@ -1148,24 +1137,11 @@ static ssize_t smtcfb_write(struct fb_info *info, const char __user *buf, · 11 unmodified lines
1148 break;1137 break;
1149 }1138 }
1150 1139
1151 for (i = c >> 2; i--;) {1140 for (i = (c + 3) >> 2; i--;) {
1152 fb_writel(big_swap(*src), dst++);1141 fb_writel(big_swap(*src), dst);
1142 dst++;
1153 src++;1143 src++;
1154 }1144 }
1155 if (c & 3) {
1156 u8 *src8 = (u8 *)src;
1157 u8 __iomem *dst8 = (u8 __iomem *)dst;
1158
1159 for (i = c & 3; i--;) {
1160 if (i & 1) {
1161 fb_writeb(*src8++, ++dst8);
1162 } else {
1163 fb_writeb(*src8++, --dst8);
1164 dst8 += 2;
1165 }
1166 }
1167 dst = (u32 __iomem *)dst8;
1168 }
1169 1145
1170 *ppos += c;1146 *ppos += c;
1171 buf += c;1147 buf += c;
drivers/video/fbdev/smscufx.c+1−2
@@ -1656,6 +1656,7 @@ static int ufx_usb_probe(struct usb_interface *interface, · 1655 unmodified lines
1656 info->par = dev;1656 info->par = dev;
1657 info->pseudo_palette = dev->pseudo_palette;1657 info->pseudo_palette = dev->pseudo_palette;
1658 info->fbops = &ufx_ops;1658 info->fbops = &ufx_ops;
1659 INIT_LIST_HEAD(&info->modelist);
1659 1660
1660 retval = fb_alloc_cmap(&info->cmap, 256, 0);1661 retval = fb_alloc_cmap(&info->cmap, 256, 0);
1661 if (retval < 0) {1662 if (retval < 0) {
@@ -1666,8 +1667,6 @@ static int ufx_usb_probe(struct usb_interface *interface, · 4 unmodified lines
1666 INIT_DELAYED_WORK(&dev->free_framebuffer_work,1667 INIT_DELAYED_WORK(&dev->free_framebuffer_work,
1667 ufx_free_framebuffer_work);1668 ufx_free_framebuffer_work);
1668 1669
1669 INIT_LIST_HEAD(&info->modelist);
1670
1671 retval = ufx_reg_read(dev, 0x3000, &id_rev);1670 retval = ufx_reg_read(dev, 0x3000, &id_rev);
1672 check_warn_goto_error(retval, "error %d reading 0x3000 register from device", retval);1671 check_warn_goto_error(retval, "error %d reading 0x3000 register from device", retval);
1673 dev_dbg(dev->gdev, "ID_REV register value 0x%08x", id_rev);1672 dev_dbg(dev->gdev, "ID_REV register value 0x%08x", id_rev);
drivers/video/fbdev/ssd1307fb.c+3−4
@@ -658,9 +658,8 @@ static int ssd1307fb_probe(struct i2c_client *client) · 657 unmodified lines
658 658
659 par->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);659 par->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
660 if (IS_ERR(par->reset)) {660 if (IS_ERR(par->reset)) {
661 dev_err(dev, "failed to get reset gpio: %ld\n",661 ret = dev_err_probe(dev, PTR_ERR(par->reset),
662 PTR_ERR(par->reset));662 "failed to get reset gpio\n");
663 ret = PTR_ERR(par->reset);
664 goto fb_alloc_error;663 goto fb_alloc_error;
665 }664 }
666 665
@@ -670,7 +669,7 @@ static int ssd1307fb_probe(struct i2c_client *client) · 3 unmodified lines
670 if (ret == -ENODEV) {669 if (ret == -ENODEV) {
671 par->vbat_reg = NULL;670 par->vbat_reg = NULL;
672 } else {671 } else {
673 dev_err(dev, "failed to get VBAT regulator: %d\n", ret);672 dev_err_probe(dev, ret, "failed to get VBAT regulator\n");
674 goto fb_alloc_error;673 goto fb_alloc_error;
675 }674 }
676 }675 }
drivers/video/fbdev/udlfb.c+4−4
@@ -1426,7 +1426,7 @@ static ssize_t metrics_bytes_rendered_show(struct device *fbdev, · 1425 unmodified lines
1426 struct device_attribute *a, char *buf) {1426 struct device_attribute *a, char *buf) {
1427 struct fb_info *fb_info = dev_get_drvdata(fbdev);1427 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1428 struct dlfb_data *dlfb = fb_info->par;1428 struct dlfb_data *dlfb = fb_info->par;
1429 return snprintf(buf, PAGE_SIZE, "%u\n",1429 return sysfs_emit(buf, "%u\n",
1430 atomic_read(&dlfb->bytes_rendered));1430 atomic_read(&dlfb->bytes_rendered));
1431}1431}
1432 1432
@@ -1434,7 +1434,7 @@ static ssize_t metrics_bytes_identical_show(struct device *fbdev, · 1 unmodified line
1434 struct device_attribute *a, char *buf) {1434 struct device_attribute *a, char *buf) {
1435 struct fb_info *fb_info = dev_get_drvdata(fbdev);1435 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1436 struct dlfb_data *dlfb = fb_info->par;1436 struct dlfb_data *dlfb = fb_info->par;
1437 return snprintf(buf, PAGE_SIZE, "%u\n",1437 return sysfs_emit(buf, "%u\n",
1438 atomic_read(&dlfb->bytes_identical));1438 atomic_read(&dlfb->bytes_identical));
1439}1439}
1440 1440
@@ -1442,7 +1442,7 @@ static ssize_t metrics_bytes_sent_show(struct device *fbdev, · 1 unmodified line
1442 struct device_attribute *a, char *buf) {1442 struct device_attribute *a, char *buf) {
1443 struct fb_info *fb_info = dev_get_drvdata(fbdev);1443 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1444 struct dlfb_data *dlfb = fb_info->par;1444 struct dlfb_data *dlfb = fb_info->par;
1445 return snprintf(buf, PAGE_SIZE, "%u\n",1445 return sysfs_emit(buf, "%u\n",
1446 atomic_read(&dlfb->bytes_sent));1446 atomic_read(&dlfb->bytes_sent));
1447}1447}
1448 1448
@@ -1450,7 +1450,7 @@ static ssize_t metrics_cpu_kcycles_used_show(struct device *fbdev, · 1 unmodified line
1450 struct device_attribute *a, char *buf) {1450 struct device_attribute *a, char *buf) {
1451 struct fb_info *fb_info = dev_get_drvdata(fbdev);1451 struct fb_info *fb_info = dev_get_drvdata(fbdev);
1452 struct dlfb_data *dlfb = fb_info->par;1452 struct dlfb_data *dlfb = fb_info->par;
1453 return snprintf(buf, PAGE_SIZE, "%u\n",1453 return sysfs_emit(buf, "%u\n",
1454 atomic_read(&dlfb->cpu_kcycles_used));1454 atomic_read(&dlfb->cpu_kcycles_used));
1455}1455}
1456 1456
drivers/video/fbdev/via/lcd.c+1−1
@@ -543,7 +543,7 @@ void viafb_lcd_set_mode(const struct fb_var_screeninfo *var, u16 cxres, · 542 unmodified lines
543 /* Get panel table Pointer */543 /* Get panel table Pointer */
544 panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);544 panel_crt_table = viafb_get_best_mode(panel_hres, panel_vres, 60);
545 viafb_fill_var_timing_info(&panel_var, panel_crt_table);545 viafb_fill_var_timing_info(&panel_var, panel_crt_table);
546 DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n");546 DEBUG_MSG(KERN_INFO "below viafb_lcd_set_mode!!\n");
547 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name)547 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name)
548 viafb_init_lvds_vt1636(plvds_setting_info, plvds_chip_info);548 viafb_init_lvds_vt1636(plvds_setting_info, plvds_chip_info);
549 clock = PICOS2KHZ(panel_crt_table->pixclock) * 1000;549 clock = PICOS2KHZ(panel_crt_table->pixclock) * 1000;
drivers/video/fbdev/via/viafbdev.c+10−0
@@ -1939,8 +1939,12 @@ static int __init viafb_setup(void) · 1938 unmodified lines
1939 1939
1940 if (!strncmp(this_opt, "viafb_mode1=", 12)) {1940 if (!strncmp(this_opt, "viafb_mode1=", 12)) {
1941 viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);1941 viafb_mode1 = kstrdup(this_opt + 12, GFP_KERNEL);
1942 if (!viafb_mode1)
1943 return -ENOMEM;
1942 } else if (!strncmp(this_opt, "viafb_mode=", 11)) {1944 } else if (!strncmp(this_opt, "viafb_mode=", 11)) {
1943 viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);1945 viafb_mode = kstrdup(this_opt + 11, GFP_KERNEL);
1946 if (!viafb_mode)
1947 return -ENOMEM;
1944 } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {1948 } else if (!strncmp(this_opt, "viafb_bpp1=", 11)) {
1945 if (kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)1949 if (kstrtouint(this_opt + 11, 0, &viafb_bpp1) < 0)
1946 return -EINVAL;1950 return -EINVAL;
@@ -1969,6 +1973,8 @@ static int __init viafb_setup(void) · 22 unmodified lines
1969 return -EINVAL;1973 return -EINVAL;
1970 } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {1974 } else if (!strncmp(this_opt, "viafb_active_dev=", 17)) {
1971 viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);1975 viafb_active_dev = kstrdup(this_opt + 17, GFP_KERNEL);
1976 if (!viafb_active_dev)
1977 return -ENOMEM;
1972 } else if (!strncmp(this_opt,1978 } else if (!strncmp(this_opt,
1973 "viafb_display_hardware_layout=", 30)) {1979 "viafb_display_hardware_layout=", 30)) {
1974 if (kstrtoint(this_opt + 30, 0,1980 if (kstrtoint(this_opt + 30, 0,
@@ -1995,8 +2001,12 @@ static int __init viafb_setup(void) · 20 unmodified lines
1995 return -EINVAL;2001 return -EINVAL;
1996 } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {2002 } else if (!strncmp(this_opt, "viafb_lcd_port=", 15)) {
1997 viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);2003 viafb_lcd_port = kstrdup(this_opt + 15, GFP_KERNEL);
2004 if (!viafb_lcd_port)
2005 return -ENOMEM;
1998 } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {2006 } else if (!strncmp(this_opt, "viafb_dvi_port=", 15)) {
1999 viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);2007 viafb_dvi_port = kstrdup(this_opt + 15, GFP_KERNEL);
2008 if (!viafb_dvi_port)
2009 return -ENOMEM;
2000 }2010 }
2001 }2011 }
2002 return 0;2012 return 0;
drivers/video/fbdev/w100fb.c+12−3
@@ -770,12 +770,18 @@ out: · 769 unmodified lines
770 fb_dealloc_cmap(&info->cmap);770 fb_dealloc_cmap(&info->cmap);
771 kfree(info->pseudo_palette);771 kfree(info->pseudo_palette);
772 }772 }
773 if (remapped_fbuf != NULL)773 if (remapped_fbuf != NULL) {
774 iounmap(remapped_fbuf);774 iounmap(remapped_fbuf);
775 if (remapped_regs != NULL)775 remapped_fbuf = NULL;
776 }
777 if (remapped_regs != NULL) {
776 iounmap(remapped_regs);778 iounmap(remapped_regs);
777 if (remapped_base != NULL)779 remapped_regs = NULL;
780 }
781 if (remapped_base != NULL) {
778 iounmap(remapped_base);782 iounmap(remapped_base);
783 remapped_base = NULL;
784 }
779 if (info)785 if (info)
780 framebuffer_release(info);786 framebuffer_release(info);
781 return err;787 return err;
@@ -795,8 +801,11 @@ static int w100fb_remove(struct platform_device *pdev) · 13 unmodified lines
795 fb_dealloc_cmap(&info->cmap);801 fb_dealloc_cmap(&info->cmap);
796 802
797 iounmap(remapped_base);803 iounmap(remapped_base);
804 remapped_base = NULL;
798 iounmap(remapped_regs);805 iounmap(remapped_regs);
806 remapped_regs = NULL;
799 iounmap(remapped_fbuf);807 iounmap(remapped_fbuf);
808 remapped_fbuf = NULL;
800 809
801 framebuffer_release(info);810 framebuffer_release(info);
802 811