diff options
author | Jakub Sitnicki <jsitnicki@gmail.com> | 2014-12-08 16:01:57 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-21 19:14:50 -0500 |
commit | eeeb98bf06286380f74fc0d39df643c50fd056e5 (patch) | |
tree | 1ac420dac2614b0932b4962fc731fa08b250f6da /drivers/pnp | |
parent | ec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff) |
PNP: Switch from __check_region() to __request_region()
PNP core is the last user of the __check_region() which has been
deprecated for almost 12 years (since v2.5.54). Replace it with a combo
of __request_region() followed by __release_region().
pnp_check_port() and pnp_check_mem() remain racy after this change.
Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/resource.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 782e82289571..f980ff7166e9 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -179,8 +179,9 @@ int pnp_check_port(struct pnp_dev *dev, struct resource *res) | |||
179 | /* check if the resource is already in use, skip if the | 179 | /* check if the resource is already in use, skip if the |
180 | * device is active because it itself may be in use */ | 180 | * device is active because it itself may be in use */ |
181 | if (!dev->active) { | 181 | if (!dev->active) { |
182 | if (__check_region(&ioport_resource, *port, length(port, end))) | 182 | if (!request_region(*port, length(port, end), "pnp")) |
183 | return 0; | 183 | return 0; |
184 | release_region(*port, length(port, end)); | ||
184 | } | 185 | } |
185 | 186 | ||
186 | /* check if the resource is reserved */ | 187 | /* check if the resource is reserved */ |
@@ -241,8 +242,9 @@ int pnp_check_mem(struct pnp_dev *dev, struct resource *res) | |||
241 | /* check if the resource is already in use, skip if the | 242 | /* check if the resource is already in use, skip if the |
242 | * device is active because it itself may be in use */ | 243 | * device is active because it itself may be in use */ |
243 | if (!dev->active) { | 244 | if (!dev->active) { |
244 | if (check_mem_region(*addr, length(addr, end))) | 245 | if (!request_mem_region(*addr, length(addr, end), "pnp")) |
245 | return 0; | 246 | return 0; |
247 | release_mem_region(*addr, length(addr, end)); | ||
246 | } | 248 | } |
247 | 249 | ||
248 | /* check if the resource is reserved */ | 250 | /* check if the resource is reserved */ |