diff options
author | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-09-08 01:45:47 -0400 |
commit | 64e47488c913ac704d465a6af86a26786d1412a5 (patch) | |
tree | d3b0148592963dcde26e4bb35ddfec8b1eaf8e23 /drivers/pnp | |
parent | 4a35a46bf1cda4737c428380d1db5d15e2590d18 (diff) | |
parent | caf39e87cc1182f7dae84eefc43ca14d54c78ef9 (diff) |
Merge linux-2.6 with linux-acpi-2.6
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/card.c | 7 | ||||
-rw-r--r-- | drivers/pnp/driver.c | 7 | ||||
-rw-r--r-- | drivers/pnp/isapnp/core.c | 33 | ||||
-rw-r--r-- | drivers/pnp/manager.c | 7 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 16 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/pnpacpi.h | 1 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/rsparser.c | 18 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 26 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/pnpbios.h | 1 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/proc.c | 8 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 16 | ||||
-rw-r--r-- | drivers/pnp/quirks.c | 7 | ||||
-rw-r--r-- | drivers/pnp/support.c | 7 |
13 files changed, 44 insertions, 110 deletions
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index 6e5229e92fbc..e95ed67d4f05 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c | |||
@@ -8,13 +8,6 @@ | |||
8 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/slab.h> | 10 | #include <linux/slab.h> |
11 | |||
12 | #ifdef CONFIG_PNP_DEBUG | ||
13 | #define DEBUG | ||
14 | #else | ||
15 | #undef DEBUG | ||
16 | #endif | ||
17 | |||
18 | #include <linux/pnp.h> | 11 | #include <linux/pnp.h> |
19 | #include "base.h" | 12 | #include "base.h" |
20 | 13 | ||
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 1d037c2a82ac..33da25f3213f 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -11,13 +11,6 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/ctype.h> | 12 | #include <linux/ctype.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | |||
15 | #ifdef CONFIG_PNP_DEBUG | ||
16 | #define DEBUG | ||
17 | #else | ||
18 | #undef DEBUG | ||
19 | #endif | ||
20 | |||
21 | #include <linux/pnp.h> | 14 | #include <linux/pnp.h> |
22 | #include "base.h" | 15 | #include "base.h" |
23 | 16 | ||
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 82c5edd5b9ee..beedd86800f4 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -142,17 +142,6 @@ static void isapnp_write_word(unsigned char idx, unsigned short val) | |||
142 | isapnp_write_byte(idx+1, val); | 142 | isapnp_write_byte(idx+1, val); |
143 | } | 143 | } |
144 | 144 | ||
145 | static void *isapnp_alloc(long size) | ||
146 | { | ||
147 | void *result; | ||
148 | |||
149 | result = kmalloc(size, GFP_KERNEL); | ||
150 | if (!result) | ||
151 | return NULL; | ||
152 | memset(result, 0, size); | ||
153 | return result; | ||
154 | } | ||
155 | |||
156 | static void isapnp_key(void) | 145 | static void isapnp_key(void) |
157 | { | 146 | { |
158 | unsigned char code = 0x6a, msb; | 147 | unsigned char code = 0x6a, msb; |
@@ -406,7 +395,7 @@ static void isapnp_parse_id(struct pnp_dev * dev, unsigned short vendor, unsigne | |||
406 | struct pnp_id * id; | 395 | struct pnp_id * id; |
407 | if (!dev) | 396 | if (!dev) |
408 | return; | 397 | return; |
409 | id = isapnp_alloc(sizeof(struct pnp_id)); | 398 | id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); |
410 | if (!id) | 399 | if (!id) |
411 | return; | 400 | return; |
412 | sprintf(id->id, "%c%c%c%x%x%x%x", | 401 | sprintf(id->id, "%c%c%c%x%x%x%x", |
@@ -430,7 +419,7 @@ static struct pnp_dev * __init isapnp_parse_device(struct pnp_card *card, int si | |||
430 | struct pnp_dev *dev; | 419 | struct pnp_dev *dev; |
431 | 420 | ||
432 | isapnp_peek(tmp, size); | 421 | isapnp_peek(tmp, size); |
433 | dev = isapnp_alloc(sizeof(struct pnp_dev)); | 422 | dev = kcalloc(1, sizeof(struct pnp_dev), GFP_KERNEL); |
434 | if (!dev) | 423 | if (!dev) |
435 | return NULL; | 424 | return NULL; |
436 | dev->number = number; | 425 | dev->number = number; |
@@ -461,7 +450,7 @@ static void __init isapnp_parse_irq_resource(struct pnp_option *option, | |||
461 | unsigned long bits; | 450 | unsigned long bits; |
462 | 451 | ||
463 | isapnp_peek(tmp, size); | 452 | isapnp_peek(tmp, size); |
464 | irq = isapnp_alloc(sizeof(struct pnp_irq)); | 453 | irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); |
465 | if (!irq) | 454 | if (!irq) |
466 | return; | 455 | return; |
467 | bits = (tmp[1] << 8) | tmp[0]; | 456 | bits = (tmp[1] << 8) | tmp[0]; |
@@ -485,7 +474,7 @@ static void __init isapnp_parse_dma_resource(struct pnp_option *option, | |||
485 | struct pnp_dma *dma; | 474 | struct pnp_dma *dma; |
486 | 475 | ||
487 | isapnp_peek(tmp, size); | 476 | isapnp_peek(tmp, size); |
488 | dma = isapnp_alloc(sizeof(struct pnp_dma)); | 477 | dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); |
489 | if (!dma) | 478 | if (!dma) |
490 | return; | 479 | return; |
491 | dma->map = tmp[0]; | 480 | dma->map = tmp[0]; |
@@ -505,7 +494,7 @@ static void __init isapnp_parse_port_resource(struct pnp_option *option, | |||
505 | struct pnp_port *port; | 494 | struct pnp_port *port; |
506 | 495 | ||
507 | isapnp_peek(tmp, size); | 496 | isapnp_peek(tmp, size); |
508 | port = isapnp_alloc(sizeof(struct pnp_port)); | 497 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
509 | if (!port) | 498 | if (!port) |
510 | return; | 499 | return; |
511 | port->min = (tmp[2] << 8) | tmp[1]; | 500 | port->min = (tmp[2] << 8) | tmp[1]; |
@@ -528,7 +517,7 @@ static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option, | |||
528 | struct pnp_port *port; | 517 | struct pnp_port *port; |
529 | 518 | ||
530 | isapnp_peek(tmp, size); | 519 | isapnp_peek(tmp, size); |
531 | port = isapnp_alloc(sizeof(struct pnp_port)); | 520 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
532 | if (!port) | 521 | if (!port) |
533 | return; | 522 | return; |
534 | port->min = port->max = (tmp[1] << 8) | tmp[0]; | 523 | port->min = port->max = (tmp[1] << 8) | tmp[0]; |
@@ -550,7 +539,7 @@ static void __init isapnp_parse_mem_resource(struct pnp_option *option, | |||
550 | struct pnp_mem *mem; | 539 | struct pnp_mem *mem; |
551 | 540 | ||
552 | isapnp_peek(tmp, size); | 541 | isapnp_peek(tmp, size); |
553 | mem = isapnp_alloc(sizeof(struct pnp_mem)); | 542 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
554 | if (!mem) | 543 | if (!mem) |
555 | return; | 544 | return; |
556 | mem->min = ((tmp[2] << 8) | tmp[1]) << 8; | 545 | mem->min = ((tmp[2] << 8) | tmp[1]) << 8; |
@@ -573,7 +562,7 @@ static void __init isapnp_parse_mem32_resource(struct pnp_option *option, | |||
573 | struct pnp_mem *mem; | 562 | struct pnp_mem *mem; |
574 | 563 | ||
575 | isapnp_peek(tmp, size); | 564 | isapnp_peek(tmp, size); |
576 | mem = isapnp_alloc(sizeof(struct pnp_mem)); | 565 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
577 | if (!mem) | 566 | if (!mem) |
578 | return; | 567 | return; |
579 | mem->min = (tmp[4] << 24) | (tmp[3] << 16) | (tmp[2] << 8) | tmp[1]; | 568 | mem->min = (tmp[4] << 24) | (tmp[3] << 16) | (tmp[2] << 8) | tmp[1]; |
@@ -595,7 +584,7 @@ static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option, | |||
595 | struct pnp_mem *mem; | 584 | struct pnp_mem *mem; |
596 | 585 | ||
597 | isapnp_peek(tmp, size); | 586 | isapnp_peek(tmp, size); |
598 | mem = isapnp_alloc(sizeof(struct pnp_mem)); | 587 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
599 | if (!mem) | 588 | if (!mem) |
600 | return; | 589 | return; |
601 | mem->min = mem->max = (tmp[4] << 24) | (tmp[3] << 16) | (tmp[2] << 8) | tmp[1]; | 590 | mem->min = mem->max = (tmp[4] << 24) | (tmp[3] << 16) | (tmp[2] << 8) | tmp[1]; |
@@ -838,7 +827,7 @@ static unsigned char __init isapnp_checksum(unsigned char *data) | |||
838 | 827 | ||
839 | static void isapnp_parse_card_id(struct pnp_card * card, unsigned short vendor, unsigned short device) | 828 | static void isapnp_parse_card_id(struct pnp_card * card, unsigned short vendor, unsigned short device) |
840 | { | 829 | { |
841 | struct pnp_id * id = isapnp_alloc(sizeof(struct pnp_id)); | 830 | struct pnp_id * id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); |
842 | if (!id) | 831 | if (!id) |
843 | return; | 832 | return; |
844 | sprintf(id->id, "%c%c%c%x%x%x%x", | 833 | sprintf(id->id, "%c%c%c%x%x%x%x", |
@@ -874,7 +863,7 @@ static int __init isapnp_build_device_list(void) | |||
874 | header[4], header[5], header[6], header[7], header[8]); | 863 | header[4], header[5], header[6], header[7], header[8]); |
875 | printk(KERN_DEBUG "checksum = 0x%x\n", checksum); | 864 | printk(KERN_DEBUG "checksum = 0x%x\n", checksum); |
876 | #endif | 865 | #endif |
877 | if ((card = isapnp_alloc(sizeof(struct pnp_card))) == NULL) | 866 | if ((card = kcalloc(1, sizeof(struct pnp_card), GFP_KERNEL)) == NULL) |
878 | continue; | 867 | continue; |
879 | 868 | ||
880 | card->number = csn; | 869 | card->number = csn; |
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 6c510c19ad7d..94442ffd4aed 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -11,13 +11,6 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | |||
15 | #ifdef CONFIG_PNP_DEBUG | ||
16 | #define DEBUG | ||
17 | #else | ||
18 | #undef DEBUG | ||
19 | #endif | ||
20 | |||
21 | #include <linux/pnp.h> | 14 | #include <linux/pnp.h> |
22 | #include "base.h" | 15 | #include "base.h" |
23 | 16 | ||
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 8655dd2e5b83..1a8915e74160 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include <linux/config.h> | ||
22 | #include <linux/acpi.h> | 23 | #include <linux/acpi.h> |
23 | #include <linux/pnp.h> | 24 | #include <linux/pnp.h> |
24 | #include <acpi/acpi_bus.h> | 25 | #include <acpi/acpi_bus.h> |
@@ -41,14 +42,6 @@ static inline int is_exclusive_device(struct acpi_device *dev) | |||
41 | return (!acpi_match_ids(dev, excluded_id_list)); | 42 | return (!acpi_match_ids(dev, excluded_id_list)); |
42 | } | 43 | } |
43 | 44 | ||
44 | void *pnpacpi_kmalloc(size_t size, int f) | ||
45 | { | ||
46 | void *p = kmalloc(size, f); | ||
47 | if (p) | ||
48 | memset(p, 0, size); | ||
49 | return p; | ||
50 | } | ||
51 | |||
52 | /* | 45 | /* |
53 | * Compatible Device IDs | 46 | * Compatible Device IDs |
54 | */ | 47 | */ |
@@ -143,7 +136,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
143 | return 0; | 136 | return 0; |
144 | 137 | ||
145 | pnp_dbg("ACPI device : hid %s", acpi_device_hid(device)); | 138 | pnp_dbg("ACPI device : hid %s", acpi_device_hid(device)); |
146 | dev = pnpacpi_kmalloc(sizeof(struct pnp_dev), GFP_KERNEL); | 139 | dev = kcalloc(1, sizeof(struct pnp_dev), GFP_KERNEL); |
147 | if (!dev) { | 140 | if (!dev) { |
148 | pnp_err("Out of memory"); | 141 | pnp_err("Out of memory"); |
149 | return -ENOMEM; | 142 | return -ENOMEM; |
@@ -173,7 +166,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
173 | dev->number = num; | 166 | dev->number = num; |
174 | 167 | ||
175 | /* set the initial values for the PnP device */ | 168 | /* set the initial values for the PnP device */ |
176 | dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), GFP_KERNEL); | 169 | dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); |
177 | if (!dev_id) | 170 | if (!dev_id) |
178 | goto err; | 171 | goto err; |
179 | pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id); | 172 | pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id); |
@@ -205,8 +198,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
205 | for (i = 0; i < cid_list->count; i++) { | 198 | for (i = 0; i < cid_list->count; i++) { |
206 | if (!ispnpidacpi(cid_list->id[i].value)) | 199 | if (!ispnpidacpi(cid_list->id[i].value)) |
207 | continue; | 200 | continue; |
208 | dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), | 201 | dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); |
209 | GFP_KERNEL); | ||
210 | if (!dev_id) | 202 | if (!dev_id) |
211 | continue; | 203 | continue; |
212 | 204 | ||
diff --git a/drivers/pnp/pnpacpi/pnpacpi.h b/drivers/pnp/pnpacpi/pnpacpi.h index 76f907e09ee6..f28e2ed66fa3 100644 --- a/drivers/pnp/pnpacpi/pnpacpi.h +++ b/drivers/pnp/pnpacpi/pnpacpi.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/acpi.h> | 5 | #include <linux/acpi.h> |
6 | #include <linux/pnp.h> | 6 | #include <linux/pnp.h> |
7 | 7 | ||
8 | void *pnpacpi_kmalloc(size_t size, int f); | ||
9 | acpi_status pnpacpi_parse_allocated_resource(acpi_handle, struct pnp_resource_table*); | 8 | acpi_status pnpacpi_parse_allocated_resource(acpi_handle, struct pnp_resource_table*); |
10 | acpi_status pnpacpi_parse_resource_option_data(acpi_handle, struct pnp_dev*); | 9 | acpi_status pnpacpi_parse_resource_option_data(acpi_handle, struct pnp_dev*); |
11 | int pnpacpi_encode_resources(struct pnp_resource_table *, struct acpi_buffer *); | 10 | int pnpacpi_encode_resources(struct pnp_resource_table *, struct acpi_buffer *); |
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 6db549c9480c..416d30debe6c 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -255,7 +255,7 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso | |||
255 | 255 | ||
256 | if (p->number_of_channels == 0) | 256 | if (p->number_of_channels == 0) |
257 | return; | 257 | return; |
258 | dma = pnpacpi_kmalloc(sizeof(struct pnp_dma), GFP_KERNEL); | 258 | dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); |
259 | if (!dma) | 259 | if (!dma) |
260 | return; | 260 | return; |
261 | 261 | ||
@@ -311,7 +311,7 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option, | |||
311 | 311 | ||
312 | if (p->number_of_interrupts == 0) | 312 | if (p->number_of_interrupts == 0) |
313 | return; | 313 | return; |
314 | irq = pnpacpi_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); | 314 | irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); |
315 | if (!irq) | 315 | if (!irq) |
316 | return; | 316 | return; |
317 | 317 | ||
@@ -332,7 +332,7 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, | |||
332 | 332 | ||
333 | if (p->number_of_interrupts == 0) | 333 | if (p->number_of_interrupts == 0) |
334 | return; | 334 | return; |
335 | irq = pnpacpi_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); | 335 | irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); |
336 | if (!irq) | 336 | if (!irq) |
337 | return; | 337 | return; |
338 | 338 | ||
@@ -353,7 +353,7 @@ pnpacpi_parse_port_option(struct pnp_option *option, | |||
353 | 353 | ||
354 | if (io->range_length == 0) | 354 | if (io->range_length == 0) |
355 | return; | 355 | return; |
356 | port = pnpacpi_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); | 356 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
357 | if (!port) | 357 | if (!port) |
358 | return; | 358 | return; |
359 | port->min = io->min_base_address; | 359 | port->min = io->min_base_address; |
@@ -374,7 +374,7 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option, | |||
374 | 374 | ||
375 | if (io->range_length == 0) | 375 | if (io->range_length == 0) |
376 | return; | 376 | return; |
377 | port = pnpacpi_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); | 377 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
378 | if (!port) | 378 | if (!port) |
379 | return; | 379 | return; |
380 | port->min = port->max = io->base_address; | 380 | port->min = port->max = io->base_address; |
@@ -393,7 +393,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option, | |||
393 | 393 | ||
394 | if (p->range_length == 0) | 394 | if (p->range_length == 0) |
395 | return; | 395 | return; |
396 | mem = pnpacpi_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 396 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
397 | if (!mem) | 397 | if (!mem) |
398 | return; | 398 | return; |
399 | mem->min = p->min_base_address; | 399 | mem->min = p->min_base_address; |
@@ -416,7 +416,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option, | |||
416 | 416 | ||
417 | if (p->range_length == 0) | 417 | if (p->range_length == 0) |
418 | return; | 418 | return; |
419 | mem = pnpacpi_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 419 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
420 | if (!mem) | 420 | if (!mem) |
421 | return; | 421 | return; |
422 | mem->min = p->min_base_address; | 422 | mem->min = p->min_base_address; |
@@ -439,7 +439,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, | |||
439 | 439 | ||
440 | if (p->range_length == 0) | 440 | if (p->range_length == 0) |
441 | return; | 441 | return; |
442 | mem = pnpacpi_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 442 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
443 | if (!mem) | 443 | if (!mem) |
444 | return; | 444 | return; |
445 | mem->min = mem->max = p->range_base_address; | 445 | mem->min = mem->max = p->range_base_address; |
@@ -623,7 +623,7 @@ int pnpacpi_build_resource_template(acpi_handle handle, | |||
623 | if (!res_cnt) | 623 | if (!res_cnt) |
624 | return -EINVAL; | 624 | return -EINVAL; |
625 | buffer->length = sizeof(struct acpi_resource) * (res_cnt + 1) + 1; | 625 | buffer->length = sizeof(struct acpi_resource) * (res_cnt + 1) + 1; |
626 | buffer->pointer = pnpacpi_kmalloc(buffer->length - 1, GFP_KERNEL); | 626 | buffer->pointer = kcalloc(1, buffer->length - 1, GFP_KERNEL); |
627 | if (!buffer->pointer) | 627 | if (!buffer->pointer) |
628 | return -ENOMEM; | 628 | return -ENOMEM; |
629 | pnp_dbg("Res cnt %d", res_cnt); | 629 | pnp_dbg("Res cnt %d", res_cnt); |
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 778a324028f4..f49674f07949 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c | |||
@@ -86,16 +86,6 @@ int pnp_bios_present(void) | |||
86 | 86 | ||
87 | struct pnp_dev_node_info node_info; | 87 | struct pnp_dev_node_info node_info; |
88 | 88 | ||
89 | void *pnpbios_kmalloc(size_t size, int f) | ||
90 | { | ||
91 | void *p = kmalloc( size, f ); | ||
92 | if ( p == NULL ) | ||
93 | printk(KERN_ERR "PnPBIOS: kmalloc() failed\n"); | ||
94 | else | ||
95 | memset(p, 0, size); | ||
96 | return p; | ||
97 | } | ||
98 | |||
99 | /* | 89 | /* |
100 | * | 90 | * |
101 | * DOCKING FUNCTIONS | 91 | * DOCKING FUNCTIONS |
@@ -121,10 +111,10 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) | |||
121 | if (!current->fs->root) { | 111 | if (!current->fs->root) { |
122 | return -EAGAIN; | 112 | return -EAGAIN; |
123 | } | 113 | } |
124 | if (!(envp = (char **) pnpbios_kmalloc (20 * sizeof (char *), GFP_KERNEL))) { | 114 | if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) { |
125 | return -ENOMEM; | 115 | return -ENOMEM; |
126 | } | 116 | } |
127 | if (!(buf = pnpbios_kmalloc (256, GFP_KERNEL))) { | 117 | if (!(buf = kcalloc (1, 256, GFP_KERNEL))) { |
128 | kfree (envp); | 118 | kfree (envp); |
129 | return -ENOMEM; | 119 | return -ENOMEM; |
130 | } | 120 | } |
@@ -231,7 +221,7 @@ static int pnpbios_get_resources(struct pnp_dev * dev, struct pnp_resource_table | |||
231 | if(!pnpbios_is_dynamic(dev)) | 221 | if(!pnpbios_is_dynamic(dev)) |
232 | return -EPERM; | 222 | return -EPERM; |
233 | 223 | ||
234 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 224 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
235 | if (!node) | 225 | if (!node) |
236 | return -1; | 226 | return -1; |
237 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { | 227 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { |
@@ -254,7 +244,7 @@ static int pnpbios_set_resources(struct pnp_dev * dev, struct pnp_resource_table | |||
254 | if (!pnpbios_is_dynamic(dev)) | 244 | if (!pnpbios_is_dynamic(dev)) |
255 | return -EPERM; | 245 | return -EPERM; |
256 | 246 | ||
257 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 247 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
258 | if (!node) | 248 | if (!node) |
259 | return -1; | 249 | return -1; |
260 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { | 250 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { |
@@ -305,7 +295,7 @@ static int pnpbios_disable_resources(struct pnp_dev *dev) | |||
305 | if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) | 295 | if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) |
306 | return -EPERM; | 296 | return -EPERM; |
307 | 297 | ||
308 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 298 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
309 | if (!node) | 299 | if (!node) |
310 | return -ENOMEM; | 300 | return -ENOMEM; |
311 | 301 | ||
@@ -347,7 +337,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node) | |||
347 | } | 337 | } |
348 | 338 | ||
349 | /* set the initial values for the PnP device */ | 339 | /* set the initial values for the PnP device */ |
350 | dev_id = pnpbios_kmalloc(sizeof(struct pnp_id), GFP_KERNEL); | 340 | dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); |
351 | if (!dev_id) | 341 | if (!dev_id) |
352 | return -1; | 342 | return -1; |
353 | pnpid32_to_pnpid(node->eisa_id,id); | 343 | pnpid32_to_pnpid(node->eisa_id,id); |
@@ -385,7 +375,7 @@ static void __init build_devlist(void) | |||
385 | struct pnp_bios_node *node; | 375 | struct pnp_bios_node *node; |
386 | struct pnp_dev *dev; | 376 | struct pnp_dev *dev; |
387 | 377 | ||
388 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 378 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
389 | if (!node) | 379 | if (!node) |
390 | return; | 380 | return; |
391 | 381 | ||
@@ -402,7 +392,7 @@ static void __init build_devlist(void) | |||
402 | break; | 392 | break; |
403 | } | 393 | } |
404 | nodes_got++; | 394 | nodes_got++; |
405 | dev = pnpbios_kmalloc(sizeof (struct pnp_dev), GFP_KERNEL); | 395 | dev = kcalloc(1, sizeof (struct pnp_dev), GFP_KERNEL); |
406 | if (!dev) | 396 | if (!dev) |
407 | break; | 397 | break; |
408 | if(insert_device(dev,node)<0) | 398 | if(insert_device(dev,node)<0) |
diff --git a/drivers/pnp/pnpbios/pnpbios.h b/drivers/pnp/pnpbios/pnpbios.h index 01896e705ed4..d8cb2fd1f127 100644 --- a/drivers/pnp/pnpbios/pnpbios.h +++ b/drivers/pnp/pnpbios/pnpbios.h | |||
@@ -26,7 +26,6 @@ union pnp_bios_install_struct { | |||
26 | 26 | ||
27 | extern int pnp_bios_present(void); | 27 | extern int pnp_bios_present(void); |
28 | extern int pnpbios_dont_use_current_config; | 28 | extern int pnpbios_dont_use_current_config; |
29 | extern void *pnpbios_kmalloc(size_t size, int f); | ||
30 | 29 | ||
31 | extern int pnpbios_parse_data_stream(struct pnp_dev *dev, struct pnp_bios_node * node); | 30 | extern int pnpbios_parse_data_stream(struct pnp_dev *dev, struct pnp_bios_node * node); |
32 | extern int pnpbios_read_resources_from_node(struct pnp_resource_table *res, struct pnp_bios_node * node); | 31 | extern int pnpbios_read_resources_from_node(struct pnp_resource_table *res, struct pnp_bios_node * node); |
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c index 6bb8e1973fd4..5a3dfc97f5e9 100644 --- a/drivers/pnp/pnpbios/proc.c +++ b/drivers/pnp/pnpbios/proc.c | |||
@@ -87,7 +87,7 @@ static int proc_read_escd(char *buf, char **start, off_t pos, | |||
87 | return -EFBIG; | 87 | return -EFBIG; |
88 | } | 88 | } |
89 | 89 | ||
90 | tmpbuf = pnpbios_kmalloc(escd.escd_size, GFP_KERNEL); | 90 | tmpbuf = kcalloc(1, escd.escd_size, GFP_KERNEL); |
91 | if (!tmpbuf) return -ENOMEM; | 91 | if (!tmpbuf) return -ENOMEM; |
92 | 92 | ||
93 | if (pnp_bios_read_escd(tmpbuf, escd.nv_storage_base)) { | 93 | if (pnp_bios_read_escd(tmpbuf, escd.nv_storage_base)) { |
@@ -133,7 +133,7 @@ static int proc_read_devices(char *buf, char **start, off_t pos, | |||
133 | if (pos >= 0xff) | 133 | if (pos >= 0xff) |
134 | return 0; | 134 | return 0; |
135 | 135 | ||
136 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 136 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
137 | if (!node) return -ENOMEM; | 137 | if (!node) return -ENOMEM; |
138 | 138 | ||
139 | for (nodenum=pos; nodenum<0xff; ) { | 139 | for (nodenum=pos; nodenum<0xff; ) { |
@@ -168,7 +168,7 @@ static int proc_read_node(char *buf, char **start, off_t pos, | |||
168 | u8 nodenum = (long)data; | 168 | u8 nodenum = (long)data; |
169 | int len; | 169 | int len; |
170 | 170 | ||
171 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 171 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
172 | if (!node) return -ENOMEM; | 172 | if (!node) return -ENOMEM; |
173 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { | 173 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { |
174 | kfree(node); | 174 | kfree(node); |
@@ -188,7 +188,7 @@ static int proc_write_node(struct file *file, const char __user *buf, | |||
188 | u8 nodenum = (long)data; | 188 | u8 nodenum = (long)data; |
189 | int ret = count; | 189 | int ret = count; |
190 | 190 | ||
191 | node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); | 191 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); |
192 | if (!node) | 192 | if (!node) |
193 | return -ENOMEM; | 193 | return -ENOMEM; |
194 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { | 194 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { |
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index e305bb132c24..b0ca65b68645 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -247,7 +247,7 @@ static void | |||
247 | pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) | 247 | pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) |
248 | { | 248 | { |
249 | struct pnp_mem * mem; | 249 | struct pnp_mem * mem; |
250 | mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 250 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
251 | if (!mem) | 251 | if (!mem) |
252 | return; | 252 | return; |
253 | mem->min = ((p[5] << 8) | p[4]) << 8; | 253 | mem->min = ((p[5] << 8) | p[4]) << 8; |
@@ -263,7 +263,7 @@ static void | |||
263 | pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) | 263 | pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) |
264 | { | 264 | { |
265 | struct pnp_mem * mem; | 265 | struct pnp_mem * mem; |
266 | mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 266 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
267 | if (!mem) | 267 | if (!mem) |
268 | return; | 268 | return; |
269 | mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; | 269 | mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; |
@@ -279,7 +279,7 @@ static void | |||
279 | pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) | 279 | pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) |
280 | { | 280 | { |
281 | struct pnp_mem * mem; | 281 | struct pnp_mem * mem; |
282 | mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); | 282 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); |
283 | if (!mem) | 283 | if (!mem) |
284 | return; | 284 | return; |
285 | mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; | 285 | mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; |
@@ -296,7 +296,7 @@ pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option) | |||
296 | struct pnp_irq * irq; | 296 | struct pnp_irq * irq; |
297 | unsigned long bits; | 297 | unsigned long bits; |
298 | 298 | ||
299 | irq = pnpbios_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); | 299 | irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); |
300 | if (!irq) | 300 | if (!irq) |
301 | return; | 301 | return; |
302 | bits = (p[2] << 8) | p[1]; | 302 | bits = (p[2] << 8) | p[1]; |
@@ -313,7 +313,7 @@ static void | |||
313 | pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) | 313 | pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) |
314 | { | 314 | { |
315 | struct pnp_dma * dma; | 315 | struct pnp_dma * dma; |
316 | dma = pnpbios_kmalloc(sizeof(struct pnp_dma), GFP_KERNEL); | 316 | dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); |
317 | if (!dma) | 317 | if (!dma) |
318 | return; | 318 | return; |
319 | dma->map = p[1]; | 319 | dma->map = p[1]; |
@@ -326,7 +326,7 @@ static void | |||
326 | pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) | 326 | pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) |
327 | { | 327 | { |
328 | struct pnp_port * port; | 328 | struct pnp_port * port; |
329 | port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); | 329 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
330 | if (!port) | 330 | if (!port) |
331 | return; | 331 | return; |
332 | port->min = (p[3] << 8) | p[2]; | 332 | port->min = (p[3] << 8) | p[2]; |
@@ -342,7 +342,7 @@ static void | |||
342 | pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) | 342 | pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) |
343 | { | 343 | { |
344 | struct pnp_port * port; | 344 | struct pnp_port * port; |
345 | port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); | 345 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); |
346 | if (!port) | 346 | if (!port) |
347 | return; | 347 | return; |
348 | port->min = port->max = (p[2] << 8) | p[1]; | 348 | port->min = port->max = (p[2] << 8) | p[1]; |
@@ -530,7 +530,7 @@ pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de | |||
530 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ | 530 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ |
531 | if (len != 4) | 531 | if (len != 4) |
532 | goto len_err; | 532 | goto len_err; |
533 | dev_id = pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); | 533 | dev_id = kcalloc(1, sizeof (struct pnp_id), GFP_KERNEL); |
534 | if (!dev_id) | 534 | if (!dev_id) |
535 | return NULL; | 535 | return NULL; |
536 | memset(dev_id, 0, sizeof(struct pnp_id)); | 536 | memset(dev_id, 0, sizeof(struct pnp_id)); |
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 596a02d7e03d..8936b0cb2ec3 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c | |||
@@ -16,13 +16,6 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/string.h> | 17 | #include <linux/string.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | |||
20 | #ifdef CONFIG_PNP_DEBUG | ||
21 | #define DEBUG | ||
22 | #else | ||
23 | #undef DEBUG | ||
24 | #endif | ||
25 | |||
26 | #include <linux/pnp.h> | 19 | #include <linux/pnp.h> |
27 | #include "base.h" | 20 | #include "base.h" |
28 | 21 | ||
diff --git a/drivers/pnp/support.c b/drivers/pnp/support.c index b952aec49189..61fe998944bd 100644 --- a/drivers/pnp/support.c +++ b/drivers/pnp/support.c | |||
@@ -8,13 +8,6 @@ | |||
8 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/ctype.h> | 10 | #include <linux/ctype.h> |
11 | |||
12 | #ifdef CONFIG_PNP_DEBUG | ||
13 | #define DEBUG | ||
14 | #else | ||
15 | #undef DEBUG | ||
16 | #endif | ||
17 | |||
18 | #include <linux/pnp.h> | 11 | #include <linux/pnp.h> |
19 | #include "base.h" | 12 | #include "base.h" |
20 | 13 | ||