Skip to content

Commit 55c225f

Browse files
committed
Merge tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev
Pull fbdev fixes and cleanups from Helge Deller: "Just the usual bunch of code cleanups in various drivers, this time mostly in vgacon and imxfb: - Code cleanup in vgacon (Jiri Slaby) - Explicitly include correct DT includes (Rob Herring) - imxfb code cleanup (Yangtao Li, Martin Kaiser) - kyrofb: make arrays const and smaller (Colin Ian King) - ep93xx-fb: return value check fix (Yuanjun Gong) - au1200fb: add missing IRQ check (Zhang Shurong)" * tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: Explicitly include correct DT includes fbdev: ep93xx-fb: fix return value check in ep93xxfb_probe fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe fbdev: kyro: make some const read-only arrays static and reduce type size fbcon: remove unused display (p) from fbcon_redraw() sticon: make sticon_set_def_font() void and remove op parameter vgacon: cache vc_cell_height in vgacon_cursor() vgacon: let vgacon_doresize() return void vgacon: remove unused xpos from vgacon_set_cursor_size() vgacon: remove unneeded forward declarations vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen() fbdev: imxfb: remove unneeded labels fbdev: imxfb: Convert to devm_platform_ioremap_resource() fbdev: imxfb: Convert to devm_kmalloc_array() fbdev: imxfb: Removed unneeded release_mem_region fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS fbdev: imxfb: warn about invalid left/right margin
2 parents 4e076c7 + e8812ac commit 55c225f

File tree

25 files changed

+97
-118
lines changed

25 files changed

+97
-118
lines changed

drivers/video/console/sticon.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static bool sticon_scroll(struct vc_data *conp, unsigned int t,
156156
return false;
157157
}
158158

159-
static int sticon_set_def_font(int unit, struct console_font *op)
159+
static void sticon_set_def_font(int unit)
160160
{
161161
if (font_data[unit] != STI_DEF_FONT) {
162162
if (--FNTREFCOUNT(font_data[unit]) == 0) {
@@ -165,8 +165,6 @@ static int sticon_set_def_font(int unit, struct console_font *op)
165165
}
166166
font_data[unit] = STI_DEF_FONT;
167167
}
168-
169-
return 0;
170168
}
171169

172170
static int sticon_set_font(struct vc_data *vc, struct console_font *op,
@@ -246,7 +244,7 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op,
246244
vc->vc_video_erase_char, font_data[vc->vc_num]);
247245

248246
/* delete old font in case it is a user font */
249-
sticon_set_def_font(unit, NULL);
247+
sticon_set_def_font(unit);
250248

251249
FNTREFCOUNT(cooked_font)++;
252250
font_data[unit] = cooked_font;
@@ -264,7 +262,9 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op,
264262

265263
static int sticon_font_default(struct vc_data *vc, struct console_font *op, char *name)
266264
{
267-
return sticon_set_def_font(vc->vc_num, op);
265+
sticon_set_def_font(vc->vc_num);
266+
267+
return 0;
268268
}
269269

270270
static int sticon_font_set(struct vc_data *vc, struct console_font *font,
@@ -297,7 +297,7 @@ static void sticon_deinit(struct vc_data *c)
297297

298298
/* free memory used by user font */
299299
for (i = 0; i < MAX_NR_CONSOLES; i++)
300-
sticon_set_def_font(i, NULL);
300+
sticon_set_def_font(i);
301301
}
302302

303303
static void sticon_clear(struct vc_data *conp, int sy, int sx, int height,

drivers/video/console/vgacon.c

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,8 @@ static struct vgastate vgastate;
6565
* Interface used by the world
6666
*/
6767

68-
static const char *vgacon_startup(void);
69-
static void vgacon_init(struct vc_data *c, int init);
70-
static void vgacon_deinit(struct vc_data *c);
71-
static void vgacon_cursor(struct vc_data *c, int mode);
72-
static int vgacon_switch(struct vc_data *c);
73-
static int vgacon_blank(struct vc_data *c, int blank, int mode_switch);
74-
static void vgacon_scrolldelta(struct vc_data *c, int lines);
7568
static int vgacon_set_origin(struct vc_data *c);
76-
static void vgacon_save_screen(struct vc_data *c);
77-
static void vgacon_invert_region(struct vc_data *c, u16 * p, int count);
69+
7870
static struct uni_pagedict *vgacon_uni_pagedir;
7971
static int vgacon_refcount;
8072

@@ -142,19 +134,19 @@ static inline void vga_set_mem_top(struct vc_data *c)
142134
write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2);
143135
}
144136

145-
static void vgacon_restore_screen(struct vc_data *c)
146-
{
147-
if (c->vc_origin != c->vc_visible_origin)
148-
vgacon_scrolldelta(c, 0);
149-
}
150-
151137
static void vgacon_scrolldelta(struct vc_data *c, int lines)
152138
{
153139
vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base,
154140
vga_vram_size);
155141
vga_set_mem_top(c);
156142
}
157143

144+
static void vgacon_restore_screen(struct vc_data *c)
145+
{
146+
if (c->vc_origin != c->vc_visible_origin)
147+
vgacon_scrolldelta(c, 0);
148+
}
149+
158150
static const char *vgacon_startup(void)
159151
{
160152
const char *display_desc = NULL;
@@ -445,7 +437,7 @@ static void vgacon_invert_region(struct vc_data *c, u16 * p, int count)
445437
}
446438
}
447439

448-
static void vgacon_set_cursor_size(int xpos, int from, int to)
440+
static void vgacon_set_cursor_size(int from, int to)
449441
{
450442
unsigned long flags;
451443
int curs, cure;
@@ -478,70 +470,61 @@ static void vgacon_set_cursor_size(int xpos, int from, int to)
478470

479471
static void vgacon_cursor(struct vc_data *c, int mode)
480472
{
473+
unsigned int c_height;
474+
481475
if (c->vc_mode != KD_TEXT)
482476
return;
483477

484478
vgacon_restore_screen(c);
485479

480+
c_height = c->vc_cell_height;
481+
486482
switch (mode) {
487483
case CM_ERASE:
488484
write_vga(14, (c->vc_pos - vga_vram_base) / 2);
489485
if (vga_video_type >= VIDEO_TYPE_VGAC)
490-
vgacon_set_cursor_size(c->state.x, 31, 30);
486+
vgacon_set_cursor_size(31, 30);
491487
else
492-
vgacon_set_cursor_size(c->state.x, 31, 31);
488+
vgacon_set_cursor_size(31, 31);
493489
break;
494490

495491
case CM_MOVE:
496492
case CM_DRAW:
497493
write_vga(14, (c->vc_pos - vga_vram_base) / 2);
498494
switch (CUR_SIZE(c->vc_cursor_type)) {
499495
case CUR_UNDERLINE:
500-
vgacon_set_cursor_size(c->state.x,
501-
c->vc_cell_height -
502-
(c->vc_cell_height <
503-
10 ? 2 : 3),
504-
c->vc_cell_height -
505-
(c->vc_cell_height <
506-
10 ? 1 : 2));
496+
vgacon_set_cursor_size(c_height -
497+
(c_height < 10 ? 2 : 3),
498+
c_height -
499+
(c_height < 10 ? 1 : 2));
507500
break;
508501
case CUR_TWO_THIRDS:
509-
vgacon_set_cursor_size(c->state.x,
510-
c->vc_cell_height / 3,
511-
c->vc_cell_height -
512-
(c->vc_cell_height <
513-
10 ? 1 : 2));
502+
vgacon_set_cursor_size(c_height / 3, c_height -
503+
(c_height < 10 ? 1 : 2));
514504
break;
515505
case CUR_LOWER_THIRD:
516-
vgacon_set_cursor_size(c->state.x,
517-
(c->vc_cell_height * 2) / 3,
518-
c->vc_cell_height -
519-
(c->vc_cell_height <
520-
10 ? 1 : 2));
506+
vgacon_set_cursor_size(c_height * 2 / 3, c_height -
507+
(c_height < 10 ? 1 : 2));
521508
break;
522509
case CUR_LOWER_HALF:
523-
vgacon_set_cursor_size(c->state.x,
524-
c->vc_cell_height / 2,
525-
c->vc_cell_height -
526-
(c->vc_cell_height <
527-
10 ? 1 : 2));
510+
vgacon_set_cursor_size(c_height / 2, c_height -
511+
(c_height < 10 ? 1 : 2));
528512
break;
529513
case CUR_NONE:
530514
if (vga_video_type >= VIDEO_TYPE_VGAC)
531-
vgacon_set_cursor_size(c->state.x, 31, 30);
515+
vgacon_set_cursor_size(31, 30);
532516
else
533-
vgacon_set_cursor_size(c->state.x, 31, 31);
517+
vgacon_set_cursor_size(31, 31);
534518
break;
535519
default:
536-
vgacon_set_cursor_size(c->state.x, 1,
537-
c->vc_cell_height);
520+
vgacon_set_cursor_size(1, c_height);
538521
break;
539522
}
540523
break;
541524
}
542525
}
543526

544-
static int vgacon_doresize(struct vc_data *c,
527+
static void vgacon_doresize(struct vc_data *c,
545528
unsigned int width, unsigned int height)
546529
{
547530
unsigned long flags;
@@ -600,7 +583,6 @@ static int vgacon_doresize(struct vc_data *c,
600583
}
601584

602585
raw_spin_unlock_irqrestore(&vga_lock, flags);
603-
return 0;
604586
}
605587

606588
static int vgacon_switch(struct vc_data *c)

drivers/video/fbdev/au1200fb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,9 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17321732

17331733
/* Now hook interrupt too */
17341734
irq = platform_get_irq(dev, 0);
1735+
if (irq < 0)
1736+
return irq;
1737+
17351738
ret = request_irq(irq, au1200fb_handle_irq,
17361739
IRQF_SHARED, "lcd", (void *)dev);
17371740
if (ret) {

drivers/video/fbdev/bw2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <linux/init.h>
1818
#include <linux/fb.h>
1919
#include <linux/mm.h>
20-
#include <linux/of_device.h>
20+
#include <linux/of.h>
21+
#include <linux/platform_device.h>
2122

2223
#include <asm/io.h>
2324
#include <asm/fbio.h>

drivers/video/fbdev/cg14.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <linux/fb.h>
1818
#include <linux/mm.h>
1919
#include <linux/uaccess.h>
20-
#include <linux/of_device.h>
20+
#include <linux/of.h>
21+
#include <linux/platform_device.h>
2122

2223
#include <asm/io.h>
2324
#include <asm/fbio.h>

drivers/video/fbdev/cg3.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <linux/init.h>
1818
#include <linux/fb.h>
1919
#include <linux/mm.h>
20-
#include <linux/of_device.h>
20+
#include <linux/of.h>
21+
#include <linux/platform_device.h>
2122

2223
#include <asm/io.h>
2324
#include <asm/fbio.h>

drivers/video/fbdev/cg6.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
#include <linux/init.h>
1818
#include <linux/fb.h>
1919
#include <linux/mm.h>
20-
#include <linux/of_device.h>
20+
#include <linux/of.h>
21+
#include <linux/platform_device.h>
2122

2223
#include <asm/io.h>
2324
#include <asm/fbio.h>

drivers/video/fbdev/core/fbcon.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,8 +1612,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info,
16121612
}
16131613
}
16141614

1615-
static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p,
1616-
int line, int count, int offset)
1615+
static void fbcon_redraw(struct vc_data *vc, int line, int count, int offset)
16171616
{
16181617
unsigned short *d = (unsigned short *)
16191618
(vc->vc_origin + vc->vc_size_row * line);
@@ -1827,7 +1826,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
18271826

18281827
case SCROLL_REDRAW:
18291828
redraw_up:
1830-
fbcon_redraw(vc, p, t, b - t - count,
1829+
fbcon_redraw(vc, t, b - t - count,
18311830
count * vc->vc_cols);
18321831
fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
18331832
scr_memsetw((unsigned short *) (vc->vc_origin +
@@ -1913,7 +1912,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
19131912

19141913
case SCROLL_REDRAW:
19151914
redraw_down:
1916-
fbcon_redraw(vc, p, b - 1, b - t - count,
1915+
fbcon_redraw(vc, b - 1, b - t - count,
19171916
-count * vc->vc_cols);
19181917
fbcon_clear(vc, t, 0, count, vc->vc_cols);
19191918
scr_memsetw((unsigned short *) (vc->vc_origin +

drivers/video/fbdev/ep93xx-fb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,9 @@ static int ep93xxfb_probe(struct platform_device *pdev)
548548
}
549549

550550
ep93xxfb_set_par(info);
551-
clk_prepare_enable(fbi->clk);
551+
err = clk_prepare_enable(fbi->clk);
552+
if (err)
553+
goto failed_check;
552554

553555
err = register_framebuffer(info);
554556
if (err)

drivers/video/fbdev/ffb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
#include <linux/fb.h>
1717
#include <linux/mm.h>
1818
#include <linux/timer.h>
19-
#include <linux/of_device.h>
19+
#include <linux/of.h>
20+
#include <linux/platform_device.h>
2021

2122
#include <asm/io.h>
2223
#include <asm/upa.h>

0 commit comments

Comments
 (0)