aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:09 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:22 -0400
commitf44900020926b2cb06b87f0f52643d6285514fc3 (patch)
tree081893ba769b0f89e03832995839cfea30fcf5f9 /drivers
parent81b5c75f0ed22a93c3da00650d0898eec56e1d62 (diff)
PNP: add pnp_init_resources(struct pnp_dev *) interface
Add pnp_init_resources(struct pnp_dev *) to replace pnp_init_resource_table(), which takes a pointer to the pnp_resource_table itself. Passing only the pnp_dev * reduces the possibility for error in the caller and removes the pnp_resource_table implementation detail from the interface. Even though pnp_init_resource_table() is exported, I did not export pnp_init_resources() because it is used only by the PNP core. 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')
-rw-r--r--drivers/pnp/interface.c6
-rw-r--r--drivers/pnp/isapnp/core.c4
-rw-r--r--drivers/pnp/manager.c5
-rw-r--r--drivers/pnp/pnpacpi/core.c2
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c3
-rw-r--r--drivers/pnp/pnpbios/core.c2
-rw-r--r--drivers/pnp/pnpbios/rsparser.c3
7 files changed, 14 insertions, 11 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index e882896bdbd7..cdc3ecfde6ef 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -351,14 +351,14 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
351 if (!strnicmp(buf, "auto", 4)) { 351 if (!strnicmp(buf, "auto", 4)) {
352 if (dev->active) 352 if (dev->active)
353 goto done; 353 goto done;
354 pnp_init_resource_table(&dev->res); 354 pnp_init_resources(dev);
355 retval = pnp_auto_config_dev(dev); 355 retval = pnp_auto_config_dev(dev);
356 goto done; 356 goto done;
357 } 357 }
358 if (!strnicmp(buf, "clear", 5)) { 358 if (!strnicmp(buf, "clear", 5)) {
359 if (dev->active) 359 if (dev->active)
360 goto done; 360 goto done;
361 pnp_init_resource_table(&dev->res); 361 pnp_init_resources(dev);
362 goto done; 362 goto done;
363 } 363 }
364 if (!strnicmp(buf, "get", 3)) { 364 if (!strnicmp(buf, "get", 3)) {
@@ -373,7 +373,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
373 if (dev->active) 373 if (dev->active)
374 goto done; 374 goto done;
375 buf += 3; 375 buf += 3;
376 pnp_init_resource_table(&dev->res); 376 pnp_init_resources(dev);
377 mutex_lock(&pnp_res_mutex); 377 mutex_lock(&pnp_res_mutex);
378 while (1) { 378 while (1) {
379 while (isspace(*buf)) 379 while (isspace(*buf))
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 6740016437d9..6f1007548c93 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -424,7 +424,7 @@ static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card,
424 dev->capabilities |= PNP_READ; 424 dev->capabilities |= PNP_READ;
425 dev->capabilities |= PNP_WRITE; 425 dev->capabilities |= PNP_WRITE;
426 dev->capabilities |= PNP_DISABLE; 426 dev->capabilities |= PNP_DISABLE;
427 pnp_init_resource_table(&dev->res); 427 pnp_init_resources(dev);
428 return dev; 428 return dev;
429} 429}
430 430
@@ -981,7 +981,7 @@ static int isapnp_get_resources(struct pnp_dev *dev)
981 int ret; 981 int ret;
982 982
983 dev_dbg(&dev->dev, "get resources\n"); 983 dev_dbg(&dev->dev, "get resources\n");
984 pnp_init_resource_table(&dev->res); 984 pnp_init_resources(dev);
985 isapnp_cfg_begin(dev->card->number, dev->number); 985 isapnp_cfg_begin(dev->card->number, dev->number);
986 ret = isapnp_read_resources(dev); 986 ret = isapnp_read_resources(dev);
987 isapnp_cfg_end(); 987 isapnp_cfg_end();
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 945c6201719d..c9af87a8fb16 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -272,6 +272,11 @@ void pnp_init_resource_table(struct pnp_resource_table *table)
272 } 272 }
273} 273}
274 274
275void pnp_init_resources(struct pnp_dev *dev)
276{
277 pnp_init_resource_table(&dev->res);
278}
279
275/** 280/**
276 * pnp_clean_resources - clears resources that were not manually set 281 * pnp_clean_resources - clears resources that were not manually set
277 * @res: the resources to clean 282 * @res: the resources to clean
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index 1ac894d2df5a..7e4512a60f58 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -212,7 +212,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
212 212
213 /* clear out the damaged flags */ 213 /* clear out the damaged flags */
214 if (!dev->active) 214 if (!dev->active)
215 pnp_init_resource_table(&dev->res); 215 pnp_init_resources(dev);
216 pnp_add_device(dev); 216 pnp_add_device(dev);
217 num++; 217 num++;
218 218
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index c5adf7631ac2..33dbf3644f2b 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -410,8 +410,7 @@ acpi_status pnpacpi_parse_allocated_resource(struct pnp_dev *dev)
410 410
411 dev_dbg(&dev->dev, "parse allocated resources\n"); 411 dev_dbg(&dev->dev, "parse allocated resources\n");
412 412
413 /* Blank the resource table values */ 413 pnp_init_resources(dev);
414 pnp_init_resource_table(&dev->res);
415 414
416 return acpi_walk_resources(handle, METHOD_NAME__CRS, 415 return acpi_walk_resources(handle, METHOD_NAME__CRS,
417 pnpacpi_allocated_resource, dev); 416 pnpacpi_allocated_resource, dev);
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 76d398531da6..f5477ca85956 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -347,7 +347,7 @@ static int __init insert_device(struct pnp_bios_node *node)
347 347
348 /* clear out the damaged flags */ 348 /* clear out the damaged flags */
349 if (!dev->active) 349 if (!dev->active)
350 pnp_init_resource_table(&dev->res); 350 pnp_init_resources(dev);
351 351
352 pnp_add_device(dev); 352 pnp_add_device(dev);
353 pnpbios_interface_attach_device(node); 353 pnpbios_interface_attach_device(node);
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index 7428f62db4d2..e90a3d4360b2 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -145,8 +145,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(struct pnp_dev *dev,
145 145
146 dev_dbg(&dev->dev, "parse allocated resources\n"); 146 dev_dbg(&dev->dev, "parse allocated resources\n");
147 147
148 /* Blank the resource table values */ 148 pnp_init_resources(dev);
149 pnp_init_resource_table(&dev->res);
150 149
151 while ((char *)p < (char *)end) { 150 while ((char *)p < (char *)end) {
152 151