summaryrefslogtreecommitdiff
path: root/drivers/pnp/core.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-29 02:34:28 +0400
committerLen Brown <len.brown@intel.com>2008-04-29 11:22:27 +0400
commit02d83b5da3efa3c278ce87db2637f3dd6837166d (patch)
treebd3de850c6a761de0584b5c82e22659b9f4a7482 /drivers/pnp/core.c
parent8766ad0ce8621aa6f0e4a91ef355509cc3364d5b (diff)
downloadlinux-02d83b5da3efa3c278ce87db2637f3dd6837166d.tar.xz
PNP: make pnp_resource_table private to PNP core
There are no remaining references to the PNP_MAX_* constants or the pnp_resource_table structure outside of the PNP core. Make them private to the PNP core. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r--drivers/pnp/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index cf37701a4f9e..20771b7d4482 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -106,6 +106,7 @@ static void pnp_release_device(struct device *dmdev)
pnp_free_option(dev->independent);
pnp_free_option(dev->dependent);
pnp_free_ids(dev);
+ kfree(dev->res);
kfree(dev);
}
@@ -118,6 +119,12 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid
if (!dev)
return NULL;
+ dev->res = kzalloc(sizeof(struct pnp_resource_table), GFP_KERNEL);
+ if (!dev->res) {
+ kfree(dev);
+ return NULL;
+ }
+
dev->protocol = protocol;
dev->number = id;
dev->dma_mask = DMA_24BIT_MASK;
@@ -133,6 +140,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid
dev_id = pnp_add_id(dev, pnpid);
if (!dev_id) {
+ kfree(dev->res);
kfree(dev);
return NULL;
}