Skip to content

Commit 2ead943

Browse files
committed
uvesafb: improve parameter handling.
1) Now module_param(..., invbool, ...) requires a bool, and similarly module_param(..., bool, ...) allows it, change pmi_setpal to a bool. 2) #define param_get_scroll to NULL, since it can never be called (perm argument to module_param_named is 0). 3) Return -EINVAL from param_set_scroll if the value is bad, so it's reported. Note that I don't think the old fb_get_options() is required for new drivers: the parameters automatically work as uvesafb.XXX=... anyway. Acked-by: Michał Januszewski <[email protected]> Signed-off-by: Rusty Russell <[email protected]>
1 parent fddd520 commit 2ead943

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/video/uvesafb.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {
4545
static int mtrr __devinitdata = 3; /* enable mtrr by default */
4646
static int blank = 1; /* enable blanking by default */
4747
static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */
48-
static int pmi_setpal __devinitdata = 1; /* use PMI for palette changes */
48+
static bool pmi_setpal __devinitdata = true; /* use PMI for palette changes */
4949
static int nocrtc __devinitdata; /* ignore CRTC settings */
5050
static int noedid __devinitdata; /* don't try DDC transfers */
5151
static int vram_remap __devinitdata; /* set amt. of memory to be used */
@@ -2002,11 +2002,7 @@ static void __devexit uvesafb_exit(void)
20022002

20032003
module_exit(uvesafb_exit);
20042004

2005-
static int param_get_scroll(char *buffer, struct kernel_param *kp)
2006-
{
2007-
return 0;
2008-
}
2009-
2005+
#define param_get_scroll NULL
20102006
static int param_set_scroll(const char *val, struct kernel_param *kp)
20112007
{
20122008
ypan = 0;
@@ -2017,6 +2013,8 @@ static int param_set_scroll(const char *val, struct kernel_param *kp)
20172013
ypan = 1;
20182014
else if (!strcmp(val, "ywrap"))
20192015
ypan = 2;
2016+
else
2017+
return -EINVAL;
20202018

20212019
return 0;
20222020
}

0 commit comments

Comments
 (0)