All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@linux-foundation.org>,
	"Li, Shaohua" <shaohua.li@intel.com>,
	Rene Herman <rene.herman@keyaccess.nl>,
	"yakui.zhao" <yakui.zhao@intel.com>,
	Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: [PATCH 3/3] PNP cleanups - Pass struct pnp_dev to   pnp_clean_resource_table for cleanup reasons
Date: Tue, 20 Nov 2007 10:51:29 +0100	[thread overview]
Message-ID: <1195552289.23700.167.camel@queen.suse.de> (raw)

Pass struct pnp_dev to pnp_clean_resource_table for cleanup reasons

Signed-off-by: Thomas Renninger <trenn@suse.de>

---
 drivers/pnp/manager.c |   41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)

Index: linux-2.6.24-rc2/drivers/pnp/manager.c
===================================================================
--- linux-2.6.24-rc2.orig/drivers/pnp/manager.c
+++ linux-2.6.24-rc2/drivers/pnp/manager.c
@@ -241,44 +241,43 @@ void pnp_init_resource_table(struct pnp_
  * 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)
 {
 	int idx;
 
 	for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
-		if (!(res->irq_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_irq_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->irq_resource[idx].start = -1;
-		res->irq_resource[idx].end = -1;
-		res->irq_resource[idx].flags =
+		pnp_irq_start(dev, idx) = -1;
+		pnp_irq_end(dev, idx) = -1;
+		pnp_irq_flags(dev, idx) =
 		    IORESOURCE_IRQ | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_DMA; idx++) {
-		if (!(res->dma_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_dma_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->dma_resource[idx].start = -1;
-		res->dma_resource[idx].end = -1;
-		res->dma_resource[idx].flags =
+		pnp_dma_start(dev, idx) = -1;
+		pnp_dma_end(dev, idx)   = -1;
+		pnp_dma_flags(dev, idx) =
 		    IORESOURCE_DMA | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_PORT; idx++) {
-		if (!(res->port_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_port_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->port_resource[idx].start = 0;
-		res->port_resource[idx].end = 0;
-		res->port_resource[idx].flags =
+		pnp_port_start(dev, idx) = 0;
+		pnp_port_end(dev, idx) = 0;
+		pnp_port_flags(dev, idx) =
 		    IORESOURCE_IO | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 	for (idx = 0; idx < PNP_MAX_MEM; idx++) {
-		if (!(res->mem_resource[idx].flags & IORESOURCE_AUTO))
+		if (!(pnp_mem_flags(dev, idx) & IORESOURCE_AUTO))
 			continue;
-		res->mem_resource[idx].start = 0;
-		res->mem_resource[idx].end = 0;
-		res->mem_resource[idx].flags =
+		pnp_mem_start(dev, idx) = 0;
+		pnp_mem_end(dev, idx) = 0;
+		pnp_mem_flags(dev, idx) =
 		    IORESOURCE_MEM | IORESOURCE_AUTO | IORESOURCE_UNSET;
 	}
 }
-
 /**
  * pnp_assign_resources - assigns resources to the device based on the specified dependent number
  * @dev: pointer to the desired device
@@ -298,7 +297,7 @@ static int pnp_assign_resources(struct p
 		return -ENODEV;
 
 	down(&pnp_res_mutex);
-	pnp_clean_resource_table(&dev->res);	/* start with a fresh slate */
+	pnp_clean_resource_table(dev);	/* start with a fresh slate */
 	if (dev->independent) {
 		port = dev->independent->port;
 		mem = dev->independent->mem;
@@ -370,7 +369,7 @@ static int pnp_assign_resources(struct p
 	return 1;
 
 fail:
-	pnp_clean_resource_table(&dev->res);
+	pnp_clean_resource_table(dev);
 	up(&pnp_res_mutex);
 	return 0;
 }
@@ -554,7 +553,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
 
 	/* release the resources so that other devices can use them */
 	down(&pnp_res_mutex);
-	pnp_clean_resource_table(&dev->res);
+	pnp_clean_resource_table(dev);
 	up(&pnp_res_mutex);
 
 	return 0;



             reply	other threads:[~2007-11-20  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-20  9:51 Thomas Renninger [this message]
2007-11-20 10:17 ` [PATCH 3/3] PNP cleanups - Pass struct pnp_dev to pnp_clean_resource_table for cleanup reasons Rene Herman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195552289.23700.167.camel@queen.suse.de \
    --to=trenn@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.herman@keyaccess.nl \
    --cc=shaohua.li@intel.com \
    --cc=yakui.zhao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.