]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] check_region elimination
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 22 May 2002 05:24:49 +0000 (22:24 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 22 May 2002 05:24:49 +0000 (22:24 -0700)
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 )

drivers/block/paride/paride.c

index 2e3ed60da5df94c88b33bf705fcc4b43eff10fdb..e3a6150acff64a4be5af858c3b1d213ae24d378a 100644 (file)
@@ -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)