diff options
author | Jiri Slaby <jslaby@suse.cz> | 2016-06-23 13:34:27 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-25 18:04:48 +0200 |
commit | 709280da6238629c3b488b7be87c6d9185f4d03e (patch) | |
tree | e4de3b670b42ab8b8780b14286c9cbb5d708d1fd /drivers/video | |
parent | tty: vt, consw->con_scrolldelta cleanup (diff) | |
download | linux-709280da6238629c3b488b7be87c6d9185f4d03e.tar.xz linux-709280da6238629c3b488b7be87c6d9185f4d03e.zip |
tty: vt, consw->con_set_palette cleanup
* allow NULL consw->con_set_palette (some consoles define an empty
hook)
* => remove empty hooks now
* return value of consw->con_set_palette is never checked => make the
function void
* document consw->con_set_palette a bit
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: linux-usb@vger.kernel.org
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/console/dummycon.c | 1 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 10 | ||||
-rw-r--r-- | drivers/video/console/mdacon.c | 6 | ||||
-rw-r--r-- | drivers/video/console/newport_con.c | 6 | ||||
-rw-r--r-- | drivers/video/console/sticon.c | 6 | ||||
-rw-r--r-- | drivers/video/console/vgacon.c | 7 |
6 files changed, 7 insertions, 29 deletions
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index 9ce03b9aba88..0ef544ef5634 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c @@ -71,6 +71,5 @@ const struct consw dummy_con = { .con_font_get = DUMMY, .con_font_default = DUMMY, .con_font_copy = DUMMY, - .con_set_palette = DUMMY, }; EXPORT_SYMBOL_GPL(dummy_con); diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index eadc7bf62eb3..9359b06377cf 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -170,7 +170,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, int height, int width); static int fbcon_switch(struct vc_data *vc); static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch); -static int fbcon_set_palette(struct vc_data *vc, const unsigned char *table); +static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table); /* * Internal routines @@ -2651,17 +2651,17 @@ static struct fb_cmap palette_cmap = { 0, 16, palette_red, palette_green, palette_blue, NULL }; -static int fbcon_set_palette(struct vc_data *vc, const unsigned char *table) +static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; int i, j, k, depth; u8 val; if (fbcon_is_inactive(vc, info)) - return -EINVAL; + return; if (!CON_IS_VISIBLE(vc)) - return 0; + return; depth = fb_get_color_depth(&info->var, &info->fix); if (depth > 3) { @@ -2683,7 +2683,7 @@ static int fbcon_set_palette(struct vc_data *vc, const unsigned char *table) } else fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); - return fb_set_cmap(&palette_cmap, info); + fb_set_cmap(&palette_cmap, info); } static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c index 234af26b4829..1fe5245eb6dd 100644 --- a/drivers/video/console/mdacon.c +++ b/drivers/video/console/mdacon.c @@ -481,11 +481,6 @@ static int mdacon_switch(struct vc_data *c) return 1; /* redrawing needed */ } -static int mdacon_set_palette(struct vc_data *c, const unsigned char *table) -{ - return -EINVAL; -} - static int mdacon_blank(struct vc_data *c, int blank, int mode_switch) { if (mda_type == TYPE_MDA) { @@ -572,7 +567,6 @@ static const struct consw mda_con = { .con_bmove = mdacon_bmove, .con_switch = mdacon_switch, .con_blank = mdacon_blank, - .con_set_palette = mdacon_set_palette, .con_build_attr = mdacon_build_attr, .con_invert_region = mdacon_invert_region, }; diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index eb3d4ce12cd5..a436930f9e5d 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -574,11 +574,6 @@ static int newport_font_set(struct vc_data *vc, struct console_font *font, unsig return newport_set_font(vc->vc_num, font); } -static int newport_set_palette(struct vc_data *vc, const unsigned char *table) -{ - return -EINVAL; -} - static int newport_scroll(struct vc_data *vc, int t, int b, int dir, int lines) { @@ -728,7 +723,6 @@ const struct consw newport_con = { .con_blank = newport_blank, .con_font_set = newport_font_set, .con_font_default = newport_font_default, - .con_set_palette = newport_set_palette, .con_set_origin = DUMMY, .con_save_screen = DUMMY }; diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index 20f6a2f5d4a7..fe7c4dbb676e 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c @@ -79,11 +79,6 @@ static const char *sticon_startup(void) return "STI console"; } -static int sticon_set_palette(struct vc_data *c, const unsigned char *table) -{ - return -EINVAL; -} - static void sticon_putc(struct vc_data *conp, int c, int ypos, int xpos) { int redraw_cursor = 0; @@ -353,7 +348,6 @@ static const struct consw sti_con = { .con_bmove = sticon_bmove, .con_switch = sticon_switch, .con_blank = sticon_blank, - .con_set_palette = sticon_set_palette, .con_set_origin = sticon_set_origin, .con_save_screen = sticon_save_screen, .con_build_attr = sticon_build_attr, diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index f447d6916991..aaae9bd23900 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -856,16 +856,13 @@ static void vga_set_palette(struct vc_data *vc, const unsigned char *table) } } -static int vgacon_set_palette(struct vc_data *vc, const unsigned char *table) +static void vgacon_set_palette(struct vc_data *vc, const unsigned char *table) { #ifdef CAN_LOAD_PALETTE if (vga_video_type != VIDEO_TYPE_VGAC || vga_palette_blanked || !CON_IS_VISIBLE(vc)) - return -EINVAL; + return; vga_set_palette(vc, table); - return 0; -#else - return -EINVAL; #endif } |