Get rid of __check_region in drivers/pnp/resource.c [2.6.0-test1][2.5.75-kj1]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Daniele Bellucci
Hi Adam,
could you double check this patch?tnx.
diff -urN
1.0/drivers/pnp/resource.c1.1/drivers/pnp/resource.cdrivers/pnp/resource.c +3
-2@@ -258,7 +258,9 @@/* check if the resource is already in use, skip if the * device is active because it itself may be in use */ if (!dev->active) { -if (__check_region (&ioport_resource, *port,length (port,end))) + +if (__request_region (&ioport_resource, *port,length (port,end), + dev->dev.name))return 0 ; } ---------- Forwarded Message ----------
Quoted 1 line
Subject: Re: [PATCH] Get rid of
__check_regionindrivers/pnp/resource.c
[2.6.0-test1][2.5.75-kj1]> Date: Sat, 26 Jul 2003 11:50:40 -0400
Quoted 11 lines
From: Greg KH <[email protected]>
To: Daniele Bellucci <[email protected]>
Cc: [email protected]Quoted 5 lines · Daniele Bellucci
Hi all,
the following patch compile and boot fine but i'm not sure if this is the right fix.Please tellme if correct.
Quoted 9 lines
It doesn't look correct. You should also cc: the pnp maintainer about this.
thanks,
greg k-h
-------------------------------------------------------
We only want to check if the resource is in use, not reserve it. Therefore I see __check_region as being appropriate. As long as it isn't printing a compile warning, I'd prefer to leave it. In this particular case it is not creating a race condition but for most cases it should be removed.
Also simply requesting the resource without releasing it will cause many of the drivers that actually call request_region to fail.
Thanks,
Adam