[patch 17/37] PNP: remove more pnp_resource_table arguments

Previous thread: [patch 21/37] PNP: make generic pnp_add_dma_resource() by Bjorn Helgaas on Tuesday, April 1, 2008 - 8:16 am. (1 message)

Next thread: [patch 24/37] PNP: use dev_printk when possible by Bjorn Helgaas on Tuesday, April 1, 2008 - 8:16 am. (1 message)
From: Bjorn Helgaas
Date: Tuesday, April 1, 2008 - 8:16 am

Stop passing around struct pnp_resource_table pointers.  In most cases,
the caller doesn't need to know how the resources are stored inside
the struct pnp_dev.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

---
 drivers/pnp/isapnp/core.c      |    6 ++--
 drivers/pnp/pnpacpi/core.c     |   11 ++-----
 drivers/pnp/pnpacpi/pnpacpi.h  |    6 ++--
 drivers/pnp/pnpacpi/rsparser.c |   55 +++++++++++++++++++++-----------------
 drivers/pnp/pnpbios/core.c     |    4 +-
 drivers/pnp/pnpbios/pnpbios.h  |    4 +-
 drivers/pnp/pnpbios/rsparser.c |   58 ++++++++++++++++++++---------------------
 7 files changed, 73 insertions(+), 71 deletions(-)

Index: work7/drivers/pnp/isapnp/core.c
===================================================================
--- work7.orig/drivers/pnp/isapnp/core.c	2008-03-31 17:10:39.000000000 -0600
+++ work7/drivers/pnp/isapnp/core.c	2008-03-31 17:10:45.000000000 -0600
@@ -924,9 +924,9 @@
 EXPORT_SYMBOL(isapnp_cfg_end);
 EXPORT_SYMBOL(isapnp_write_byte);
 
-static int isapnp_read_resources(struct pnp_dev *dev,
-				 struct pnp_resource_table *res)
+static int isapnp_read_resources(struct pnp_dev *dev)
 {
+	struct pnp_resource_table *res = &dev->res;
 	int tmp, ret;
 
 	dev->active = isapnp_read_byte(ISAPNP_CFG_ACTIVATE);
@@ -974,7 +974,7 @@
 
 	pnp_init_resource_table(&dev->res);
 	isapnp_cfg_begin(dev->card->number, dev->number);
-	ret = isapnp_read_resources(dev, &dev->res);
+	ret = isapnp_read_resources(dev);
 	isapnp_cfg_end();
 	return ret;
 }
Index: work7/drivers/pnp/pnpacpi/core.c
===================================================================
--- work7.orig/drivers/pnp/pnpacpi/core.c	2008-03-31 17:10:39.000000000 -0600
+++ work7/drivers/pnp/pnpacpi/core.c	2008-03-31 17:10:45.000000000 -0600
@@ -77,8 +77,7 @@
 {
 	acpi_status status;
 
-	status = pnpacpi_parse_allocated_resource((acpi_handle) dev->data,
-						  &dev->res);
+	status = pnpacpi_parse_allocated_resource(dev);
 	return ACPI_FAILURE(status) ? -ENODEV : 0;
 }
 ...
Previous thread: [patch 21/37] PNP: make generic pnp_add_dma_resource() by Bjorn Helgaas on Tuesday, April 1, 2008 - 8:16 am. (1 message)

Next thread: [patch 24/37] PNP: use dev_printk when possible by Bjorn Helgaas on Tuesday, April 1, 2008 - 8:16 am. (1 message)