aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/card.c6
-rw-r--r--drivers/pnp/system.c13
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 91c047a7e635..dd6384b1efce 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -311,7 +311,6 @@ done:
311 return NULL; 311 return NULL;
312 312
313found: 313found:
314 down_write(&dev->dev.bus->subsys.rwsem);
315 dev->card_link = clink; 314 dev->card_link = clink;
316 dev->dev.driver = &drv->link.driver; 315 dev->dev.driver = &drv->link.driver;
317 if (pnp_bus_type.probe(&dev->dev)) 316 if (pnp_bus_type.probe(&dev->dev))
@@ -319,14 +318,11 @@ found:
319 if (device_bind_driver(&dev->dev)) 318 if (device_bind_driver(&dev->dev))
320 goto err_out; 319 goto err_out;
321 320
322 up_write(&dev->dev.bus->subsys.rwsem);
323
324 return dev; 321 return dev;
325 322
326err_out: 323err_out:
327 dev->dev.driver = NULL; 324 dev->dev.driver = NULL;
328 dev->card_link = NULL; 325 dev->card_link = NULL;
329 up_write(&dev->dev.bus->subsys.rwsem);
330 return NULL; 326 return NULL;
331} 327}
332 328
@@ -340,11 +336,9 @@ void pnp_release_card_device(struct pnp_dev * dev)
340 struct pnp_card_driver * drv = dev->card_link->driver; 336 struct pnp_card_driver * drv = dev->card_link->driver;
341 if (!drv) 337 if (!drv)
342 return; 338 return;
343 down_write(&dev->dev.bus->subsys.rwsem);
344 drv->link.remove = &card_remove; 339 drv->link.remove = &card_remove;
345 device_release_driver(&dev->dev); 340 device_release_driver(&dev->dev);
346 drv->link.remove = &card_remove_first; 341 drv->link.remove = &card_remove_first;
347 up_write(&dev->dev.bus->subsys.rwsem);
348} 342}
349 343
350/* 344/*
diff --git a/drivers/pnp/system.c b/drivers/pnp/system.c
index 2065e74bb63f..a8a95540b1ef 100644
--- a/drivers/pnp/system.c
+++ b/drivers/pnp/system.c
@@ -22,7 +22,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
22 { "", 0 } 22 { "", 0 }
23}; 23};
24 24
25static void reserve_range(char *pnpid, int start, int end, int port) 25static void reserve_range(const char *pnpid, resource_size_t start, resource_size_t end, int port)
26{ 26{
27 struct resource *res; 27 struct resource *res;
28 char *regionid; 28 char *regionid;
@@ -32,9 +32,9 @@ static void reserve_range(char *pnpid, int start, int end, int port)
32 return; 32 return;
33 snprintf(regionid, 16, "pnp %s", pnpid); 33 snprintf(regionid, 16, "pnp %s", pnpid);
34 if (port) 34 if (port)
35 res = request_region(start,end-start+1,regionid); 35 res = request_region(start, end-start+1, regionid);
36 else 36 else
37 res = request_mem_region(start,end-start+1,regionid); 37 res = request_mem_region(start, end-start+1, regionid);
38 if (res == NULL) 38 if (res == NULL)
39 kfree(regionid); 39 kfree(regionid);
40 else 40 else
@@ -45,12 +45,13 @@ static void reserve_range(char *pnpid, int start, int end, int port)
45 * have double reservations. 45 * have double reservations.
46 */ 46 */
47 printk(KERN_INFO 47 printk(KERN_INFO
48 "pnp: %s: %s range 0x%x-0x%x %s reserved\n", 48 "pnp: %s: %s range 0x%llx-0x%llx %s reserved\n",
49 pnpid, port ? "ioport" : "iomem", start, end, 49 pnpid, port ? "ioport" : "iomem",
50 (unsigned long long)start, (unsigned long long)end,
50 NULL != res ? "has been" : "could not be"); 51 NULL != res ? "has been" : "could not be");
51} 52}
52 53
53static void reserve_resources_of_dev(struct pnp_dev *dev) 54static void reserve_resources_of_dev(const struct pnp_dev *dev)
54{ 55{
55 int i; 56 int i;
56 57