Commit f0e0a6df authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] check_region elimination

Trivial patch update against 2.5.17:
johnpol@2ka.mipt.ru: 21) request_region check, 21-30:
  here is one more trivial check.

  So please test and apply.

  	Evgeniy Polyakov ( s0mbre )
parent 56fede86
......@@ -296,9 +296,6 @@ static int pi_probe_mode( PIA *pi, int max, char * scratch, int verbose)
range = 3;
if (pi->mode >= pi->proto->epp_first) range = 8;
if ((range == 8) && (pi->port % 8)) return 0;
#ifndef CONFIG_PARPORT
if (check_region(pi->port,range)) return 0;
#endif /* !CONFIG_PARPORT */
pi->reserved = range;
return (!pi_test_proto(pi,scratch,verbose));
}
......@@ -307,9 +304,6 @@ static int pi_probe_mode( PIA *pi, int max, char * scratch, int verbose)
range = 3;
if (pi->mode >= pi->proto->epp_first) range = 8;
if ((range == 8) && (pi->port % 8)) break;
#ifndef CONFIG_PARPORT
if (check_region(pi->port,range)) break;
#endif /* !CONFIG_PARPORT */
pi->reserved = range;
if (!pi_test_proto(pi,scratch,verbose)) best = pi->mode;
}
......@@ -331,10 +325,6 @@ static int pi_probe_unit( PIA *pi, int unit, char * scratch, int verbose)
if (!pi_register_parport(pi,verbose))
return 0;
#ifndef CONFIG_PARPORT
if (check_region(pi->port,3)) return 0;
#endif /* !CONFIG_PARPORT */
if (pi->proto->test_port) {
pi_claim(pi);
max = pi->proto->test_port(pi);
......@@ -424,7 +414,11 @@ int pi_init(PIA *pi, int autoprobe, int port, int mode,
}
#ifndef CONFIG_PARPORT
request_region(pi->port,pi->reserved,pi->device);
if (!request_region(pi->port,pi->reserved,pi->device))
{
printk(KERN_WARNING"paride: Unable to request region 0x%x\n", pi->port);
return 0;
}
#endif /* !CONFIG_PARPORT */
if (pi->parname)
......
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