From f0e0a6dfdbc09e0bae06296c434c21089a09e59a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 21 May 2002 22:24:49 -0700 Subject: [PATCH] [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 ) --- drivers/block/paride/paride.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index 2e3ed60da5df..e3a6150acff6 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -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) -- 2.39.5