aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pnp/interface.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index 674e8ba0377f..239923a300cd 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -216,12 +216,12 @@ static ssize_t pnp_show_options(struct device *dmdev,
216 struct device_attribute *attr, char *buf) 216 struct device_attribute *attr, char *buf)
217{ 217{
218 struct pnp_dev *dev = to_pnp_dev(dmdev); 218 struct pnp_dev *dev = to_pnp_dev(dmdev);
219 pnp_info_buffer_t *buffer;
219 struct pnp_option *independent = dev->independent; 220 struct pnp_option *independent = dev->independent;
220 struct pnp_option *dependent = dev->dependent; 221 struct pnp_option *dependent = dev->dependent;
221 int ret, dep = 1; 222 int ret, dep = 1;
222 223
223 pnp_info_buffer_t *buffer = (pnp_info_buffer_t *) 224 buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
224 pnp_alloc(sizeof(pnp_info_buffer_t));
225 if (!buffer) 225 if (!buffer)
226 return -ENOMEM; 226 return -ENOMEM;
227 227
@@ -248,17 +248,18 @@ static ssize_t pnp_show_current_resources(struct device *dmdev,
248 char *buf) 248 char *buf)
249{ 249{
250 struct pnp_dev *dev = to_pnp_dev(dmdev); 250 struct pnp_dev *dev = to_pnp_dev(dmdev);
251 pnp_info_buffer_t *buffer;
251 struct pnp_resource *pnp_res; 252 struct pnp_resource *pnp_res;
252 struct resource *res; 253 struct resource *res;
253 int ret; 254 int ret;
254 pnp_info_buffer_t *buffer;
255 255
256 if (!dev) 256 if (!dev)
257 return -EINVAL; 257 return -EINVAL;
258 258
259 buffer = (pnp_info_buffer_t *) pnp_alloc(sizeof(pnp_info_buffer_t)); 259 buffer = pnp_alloc(sizeof(pnp_info_buffer_t));
260 if (!buffer) 260 if (!buffer)
261 return -ENOMEM; 261 return -ENOMEM;
262
262 buffer->len = PAGE_SIZE; 263 buffer->len = PAGE_SIZE;
263 buffer->buffer = buf; 264 buffer->buffer = buf;
264 buffer->curr = buffer->buffer; 265 buffer->curr = buffer->buffer;
@@ -295,9 +296,9 @@ static ssize_t pnp_show_current_resources(struct device *dmdev,
295 return ret; 296 return ret;
296} 297}
297 298
298static ssize_t 299static ssize_t pnp_set_current_resources(struct device *dmdev,
299pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, 300 struct device_attribute *attr,
300 const char *ubuf, size_t count) 301 const char *ubuf, size_t count)
301{ 302{
302 struct pnp_dev *dev = to_pnp_dev(dmdev); 303 struct pnp_dev *dev = to_pnp_dev(dmdev);
303 char *buf = (void *)ubuf; 304 char *buf = (void *)ubuf;