diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:28 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:27 -0400 |
commit | 02d83b5da3efa3c278ce87db2637f3dd6837166d (patch) | |
tree | bd3de850c6a761de0584b5c82e22659b9f4a7482 /drivers/pnp/core.c | |
parent | 8766ad0ce8621aa6f0e4a91ef355509cc3364d5b (diff) |
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.c | 8 |
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) | |||
106 | pnp_free_option(dev->independent); | 106 | pnp_free_option(dev->independent); |
107 | pnp_free_option(dev->dependent); | 107 | pnp_free_option(dev->dependent); |
108 | pnp_free_ids(dev); | 108 | pnp_free_ids(dev); |
109 | kfree(dev->res); | ||
109 | kfree(dev); | 110 | kfree(dev); |
110 | } | 111 | } |
111 | 112 | ||
@@ -118,6 +119,12 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid | |||
118 | if (!dev) | 119 | if (!dev) |
119 | return NULL; | 120 | return NULL; |
120 | 121 | ||
122 | dev->res = kzalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | ||
123 | if (!dev->res) { | ||
124 | kfree(dev); | ||
125 | return NULL; | ||
126 | } | ||
127 | |||
121 | dev->protocol = protocol; | 128 | dev->protocol = protocol; |
122 | dev->number = id; | 129 | dev->number = id; |
123 | dev->dma_mask = DMA_24BIT_MASK; | 130 | dev->dma_mask = DMA_24BIT_MASK; |
@@ -133,6 +140,7 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid | |||
133 | 140 | ||
134 | dev_id = pnp_add_id(dev, pnpid); | 141 | dev_id = pnp_add_id(dev, pnpid); |
135 | if (!dev_id) { | 142 | if (!dev_id) { |
143 | kfree(dev->res); | ||
136 | kfree(dev); | 144 | kfree(dev); |
137 | return NULL; | 145 | return NULL; |
138 | } | 146 | } |