Commit e9c3815e authored by Vojtech Pavlik's avatar Vojtech Pavlik

Kernel command line [__setup()] parsing fixes in all the input

drivers that use it, except i8042.
parent 3b89dbbd
...@@ -373,21 +373,21 @@ static struct db9 __init *db9_probe(int *config) ...@@ -373,21 +373,21 @@ static struct db9 __init *db9_probe(int *config)
} }
#ifndef MODULE #ifndef MODULE
int __init db9_setup(char *str) static int __init db9_setup(char *str)
{ {
int i, ints[3]; int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) db9[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 2; i++) db9[i] = ints[i + 1];
return 1; return 1;
} }
int __init db9_setup_2(char *str) static int __init db9_setup_2(char *str)
{ {
int i, ints[3]; int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 2; i++) db9_2[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 2; i++) db9_2[i] = ints[i + 1];
return 1; return 1;
} }
int __init db9_setup_3(char *str) static int __init db9_setup_3(char *str)
{ {
int i, ints[3]; int i, ints[3];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
......
...@@ -617,21 +617,21 @@ static struct gc __init *gc_probe(int *config) ...@@ -617,21 +617,21 @@ static struct gc __init *gc_probe(int *config)
} }
#ifndef MODULE #ifndef MODULE
int __init gc_setup(char *str) static int __init gc_setup(char *str)
{ {
int i, ints[7]; int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 6; i++) gc[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 6; i++) gc[i] = ints[i + 1];
return 1; return 1;
} }
int __init gc_setup_2(char *str) static int __init gc_setup_2(char *str)
{ {
int i, ints[7]; int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 6; i++) gc_2[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 6; i++) gc_2[i] = ints[i + 1];
return 1; return 1;
} }
int __init gc_setup_3(char *str) static int __init gc_setup_3(char *str)
{ {
int i, ints[7]; int i, ints[7];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
......
...@@ -208,21 +208,21 @@ static struct tgfx __init *tgfx_probe(int *config) ...@@ -208,21 +208,21 @@ static struct tgfx __init *tgfx_probe(int *config)
} }
#ifndef MODULE #ifndef MODULE
int __init tgfx_setup(char *str) static int __init tgfx_setup(char *str)
{ {
int i, ints[9]; int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 8; i++) tgfx[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 8; i++) tgfx[i] = ints[i + 1];
return 1; return 1;
} }
int __init tgfx_setup_2(char *str) static int __init tgfx_setup_2(char *str)
{ {
int i, ints[9]; int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
for (i = 0; i <= ints[0] && i < 8; i++) tgfx_2[i] = ints[i + 1]; for (i = 0; i <= ints[0] && i < 8; i++) tgfx_2[i] = ints[i + 1];
return 1; return 1;
} }
int __init tgfx_setup_3(char *str) static int __init tgfx_setup_3(char *str)
{ {
int i, ints[9]; int i, ints[9];
get_options(str, ARRAY_SIZE(ints), ints); get_options(str, ARRAY_SIZE(ints), ints);
......
...@@ -520,14 +520,16 @@ static struct serio_dev atkbd_dev = { ...@@ -520,14 +520,16 @@ static struct serio_dev atkbd_dev = {
disconnect: atkbd_disconnect disconnect: atkbd_disconnect
}; };
/* #ifndef MODULE
* Module init and exit. static int __init atkbd_setup(char *str)
*/
void __init atkbd_setup(char *str, int *ints)
{ {
if (!ints[0]) atkbd_set = ints[1]; int ints[4];
str = get_options(str, ARRAY_SIZE(ints), ints);
if (ints[0] > 0) atkbd_set = ints[1];
return 1;
} }
__setup("atkbd_set=", atkbd_setup);
#endif
int __init atkbd_init(void) int __init atkbd_init(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment