Re: [PATCH 5/5] uvesafb: improve parameter handling.

From: Michal Januszewski
Date: Mon Mar 30 2009 - 16:16:14 EST


On Sat, Mar 28, 2009 at 15:24, Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:
>
> 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.
>
> Cc: Michal Januszewski <spock@xxxxxxxxxx>
> Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

Acked-by: MichaÅ Januszewski <spock@xxxxxxxxxx>

> ---
> Âdrivers/video/uvesafb.c | Â 10 ++++------
> Â1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
> --- a/drivers/video/uvesafb.c
> +++ b/drivers/video/uvesafb.c
> @@ -45,7 +45,7 @@ static int mtrr        __devinitdata = 3; /* e
> Âstatic int mtrr        Â__devinitdata = 3; /* enable mtrr by default */
> Âstatic int blank    = 1;        /* enable blanking by default */
> Âstatic int ypan        Â= 1;       /* 0: scroll, 1: ypan, 2: ywrap */
> -static int pmi_setpal Â__devinitdata = 1; /* use PMI for palette changes */
> +static bool pmi_setpal __devinitdata = true; /* use PMI for palette changes */
> Âstatic int nocrtc   Â__devinitdata; /* ignore CRTC settings */
> Âstatic int noedid   Â__devinitdata; /* don't try DDC transfers */
> Âstatic int vram_remap Â__devinitdata; /* set amt. of memory to be used */
> @@ -2009,11 +2009,7 @@ static void __devexit uvesafb_exit(void)
>
> Âmodule_exit(uvesafb_exit);
>
> -static int param_get_scroll(char *buffer, struct kernel_param *kp)
> -{
> - Â Â Â return 0;
> -}
> -
> +#define param_get_scroll NULL
> Âstatic int param_set_scroll(const char *val, struct kernel_param *kp)
> Â{
> Â Â Â Âypan = 0;
> @@ -2024,6 +2020,8 @@ static int param_set_scroll(const char *
> Â Â Â Â Â Â Â Âypan = 1;
> Â Â Â Âelse if (!strcmp(val, "ywrap"))
> Â Â Â Â Â Â Â Âypan = 2;
> + Â Â Â else
> + Â Â Â Â Â Â Â return -EINVAL;
>
> Â Â Â Âreturn 0;
> Â}
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/