Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757555AbXKTJw0 (ORCPT ); Tue, 20 Nov 2007 04:52:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754920AbXKTJvc (ORCPT ); Tue, 20 Nov 2007 04:51:32 -0500 Received: from mx2.suse.de ([195.135.220.15]:46992 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757593AbXKTJva (ORCPT ); Tue, 20 Nov 2007 04:51:30 -0500 Subject: [PATCH 3/3] PNP cleanups - Pass struct pnp_dev to pnp_clean_resource_table for cleanup reasons From: Thomas Renninger Reply-To: trenn@suse.de To: linux-kernel Cc: akpm , "Li, Shaohua" , Rene Herman , "yakui.zhao" , Bjorn Helgaas Content-Type: text/plain Organization: Novell/SUSE Date: Tue, 20 Nov 2007 10:51:29 +0100 Message-Id: <1195552289.23700.167.camel@queen.suse.de> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3683 Lines: 108 Pass struct pnp_dev to pnp_clean_resource_table for cleanup reasons Signed-off-by: Thomas Renninger --- 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; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/