summaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 16:34:10 -0600
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:22 -0400
commit6969c7ed558cf5e9eff01734be0174a296938092 (patch)
tree46a7d9d412e000f1ee9371608147289f48fd79a1 /drivers/pnp
parentf44900020926b2cb06b87f0f52643d6285514fc3 (diff)
downloadlinux-3.10-6969c7ed558cf5e9eff01734be0174a296938092.tar.gz
linux-3.10-6969c7ed558cf5e9eff01734be0174a296938092.tar.bz2
linux-3.10-6969c7ed558cf5e9eff01734be0174a296938092.zip
PNP: remove pnp_resource_table from internal pnp_clean_resource_table interface
This changes pnp_clean_resource_table() to take a pnp_dev pointer rather than a pnp_resource_table pointer. This reduces the visibility of pnp_resource_table and removes an opportunity for error in the caller. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/manager.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index c9af87a8fb1..2251dd7da06 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -281,8 +281,9 @@ void pnp_init_resources(struct pnp_dev *dev)
* pnp_clean_resources - clears resources that were not manually set
* @res: the resources to clean
*/
-static void pnp_clean_resource_table(struct pnp_resource_table *res)
+static void pnp_clean_resource_table(struct pnp_dev *dev)
{
+ struct pnp_resource_table *res = &dev->res;
int idx;
for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
@@ -339,7 +340,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
dbg_pnp_show_resources(dev, "before pnp_assign_resources");
mutex_lock(&pnp_res_mutex);
- pnp_clean_resource_table(&dev->res); /* start with a fresh slate */
+ pnp_clean_resource_table(dev);
if (dev->independent) {
dev_dbg(&dev->dev, "assigning independent options\n");
port = dev->independent->port;
@@ -415,7 +416,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
return 1;
fail:
- pnp_clean_resource_table(&dev->res);
+ pnp_clean_resource_table(dev);
mutex_unlock(&pnp_res_mutex);
dbg_pnp_show_resources(dev, "after pnp_assign_resources (failed)");
return 0;
@@ -595,7 +596,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
/* release the resources so that other devices can use them */
mutex_lock(&pnp_res_mutex);
- pnp_clean_resource_table(&dev->res);
+ pnp_clean_resource_table(dev);
mutex_unlock(&pnp_res_mutex);
return 0;