From: Dmitry Torokhov <dtor_core@ameritech.net>

pass maximum allowed protocol to psmouse_extensions instead of accessing
psmouse_max_proto directly allowing to avoid changing the global parameter
when synaptics initialization fails


---

 25-akpm/drivers/input/mouse/psmouse-base.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff -puN drivers/input/mouse/psmouse-base.c~new-set-of-input-patches-dont-change-max-proto drivers/input/mouse/psmouse-base.c
--- 25/drivers/input/mouse/psmouse-base.c~new-set-of-input-patches-dont-change-max-proto	2004-04-21 00:22:25.301188920 -0700
+++ 25-akpm/drivers/input/mouse/psmouse-base.c	2004-04-21 00:22:25.306188160 -0700
@@ -363,7 +363,7 @@ static int im_explorer_detect(struct psm
  * the mouse may have.
  */
 
-static int psmouse_extensions(struct psmouse *psmouse)
+static int psmouse_extensions(struct psmouse *psmouse, unsigned int max_proto)
 {
 	int synaptics_hardware = 0;
 
@@ -374,12 +374,12 @@ static int psmouse_extensions(struct psm
 /*
  * Try Synaptics TouchPad
  */
-	if (psmouse_max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse)) {
+	if (max_proto > PSMOUSE_PS2 && synaptics_detect(psmouse)) {
 		synaptics_hardware = 1;
 		psmouse->vendor = "Synaptics";
 		psmouse->name = "TouchPad";
 
-		if (psmouse_max_proto > PSMOUSE_IMEX) {
+		if (max_proto > PSMOUSE_IMEX) {
 			if (synaptics_init(psmouse) == 0)
 				return PSMOUSE_SYNAPTICS;
 /*
@@ -387,7 +387,7 @@ static int psmouse_extensions(struct psm
  * Unfortunately Logitech/Genius probes confuse some firmware versions so
  * we'll have to skip them.
  */
-			psmouse_max_proto = PSMOUSE_IMEX;
+			max_proto = PSMOUSE_IMEX;
 		}
 /*
  * Make sure that touchpad is in relative mode, gestures (taps) are enabled
@@ -395,7 +395,7 @@ static int psmouse_extensions(struct psm
 		synaptics_reset(psmouse);
 	}
 
-	if (psmouse_max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) {
+	if (max_proto > PSMOUSE_IMEX && genius_detect(psmouse)) {
 		set_bit(BTN_EXTRA, psmouse->dev.keybit);
 		set_bit(BTN_SIDE, psmouse->dev.keybit);
 		set_bit(REL_WHEEL, psmouse->dev.relbit);
@@ -405,17 +405,16 @@ static int psmouse_extensions(struct psm
 		return PSMOUSE_GENPS;
 	}
 
-	if (psmouse_max_proto > PSMOUSE_IMEX) {
+	if (max_proto > PSMOUSE_IMEX) {
 		int type = ps2pp_detect(psmouse);
 		if (type)
 			return type;
 	}
 
-	if (psmouse_max_proto >= PSMOUSE_IMPS && intellimouse_detect(psmouse)) {
+	if (max_proto >= PSMOUSE_IMPS && intellimouse_detect(psmouse)) {
 		set_bit(REL_WHEEL, psmouse->dev.relbit);
 
-		if (psmouse_max_proto >= PSMOUSE_IMEX &&
-					im_explorer_detect(psmouse)) {
+		if (max_proto >= PSMOUSE_IMEX && im_explorer_detect(psmouse)) {
 			set_bit(BTN_SIDE, psmouse->dev.keybit);
 			set_bit(BTN_EXTRA, psmouse->dev.keybit);
 
@@ -478,7 +477,7 @@ static int psmouse_probe(struct psmouse 
  * basic PS/2 3-button mouse.
  */
 
-	return psmouse->type = psmouse_extensions(psmouse);
+	return psmouse->type = psmouse_extensions(psmouse, psmouse_max_proto);
 }
 
 /*

_