diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:04 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:20 -0400 |
commit | c1caf06ccfd3a4efd4b489f89bcdabd2362f31d0 (patch) | |
tree | 5571b9dc1b4b66c72ad64a406602d23112446f3e /drivers/pnp/isapnp | |
parent | cdef6254e17e98f1071ce1bfc8f2a87997c855d0 (diff) |
PNP: add debug output to option registration
Add debug output to resource option registration functions (enabled
by CONFIG_PNP_DEBUG). This uses dev_printk, so I had to add pnp_dev
arguments at the same time.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/isapnp')
-rw-r--r-- | drivers/pnp/isapnp/core.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 883577a93d6a..38ff64dce9c0 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c | |||
@@ -431,7 +431,8 @@ static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card, | |||
431 | /* | 431 | /* |
432 | * Add IRQ resource to resources list. | 432 | * Add IRQ resource to resources list. |
433 | */ | 433 | */ |
434 | static void __init isapnp_parse_irq_resource(struct pnp_option *option, | 434 | static void __init isapnp_parse_irq_resource(struct pnp_dev *dev, |
435 | struct pnp_option *option, | ||
435 | int size) | 436 | int size) |
436 | { | 437 | { |
437 | unsigned char tmp[3]; | 438 | unsigned char tmp[3]; |
@@ -448,13 +449,14 @@ static void __init isapnp_parse_irq_resource(struct pnp_option *option, | |||
448 | irq->flags = tmp[2]; | 449 | irq->flags = tmp[2]; |
449 | else | 450 | else |
450 | irq->flags = IORESOURCE_IRQ_HIGHEDGE; | 451 | irq->flags = IORESOURCE_IRQ_HIGHEDGE; |
451 | pnp_register_irq_resource(option, irq); | 452 | pnp_register_irq_resource(dev, option, irq); |
452 | } | 453 | } |
453 | 454 | ||
454 | /* | 455 | /* |
455 | * Add DMA resource to resources list. | 456 | * Add DMA resource to resources list. |
456 | */ | 457 | */ |
457 | static void __init isapnp_parse_dma_resource(struct pnp_option *option, | 458 | static void __init isapnp_parse_dma_resource(struct pnp_dev *dev, |
459 | struct pnp_option *option, | ||
458 | int size) | 460 | int size) |
459 | { | 461 | { |
460 | unsigned char tmp[2]; | 462 | unsigned char tmp[2]; |
@@ -466,13 +468,14 @@ static void __init isapnp_parse_dma_resource(struct pnp_option *option, | |||
466 | return; | 468 | return; |
467 | dma->map = tmp[0]; | 469 | dma->map = tmp[0]; |
468 | dma->flags = tmp[1]; | 470 | dma->flags = tmp[1]; |
469 | pnp_register_dma_resource(option, dma); | 471 | pnp_register_dma_resource(dev, option, dma); |
470 | } | 472 | } |
471 | 473 | ||
472 | /* | 474 | /* |
473 | * Add port resource to resources list. | 475 | * Add port resource to resources list. |
474 | */ | 476 | */ |
475 | static void __init isapnp_parse_port_resource(struct pnp_option *option, | 477 | static void __init isapnp_parse_port_resource(struct pnp_dev *dev, |
478 | struct pnp_option *option, | ||
476 | int size) | 479 | int size) |
477 | { | 480 | { |
478 | unsigned char tmp[7]; | 481 | unsigned char tmp[7]; |
@@ -487,13 +490,14 @@ static void __init isapnp_parse_port_resource(struct pnp_option *option, | |||
487 | port->align = tmp[5]; | 490 | port->align = tmp[5]; |
488 | port->size = tmp[6]; | 491 | port->size = tmp[6]; |
489 | port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0; | 492 | port->flags = tmp[0] ? PNP_PORT_FLAG_16BITADDR : 0; |
490 | pnp_register_port_resource(option, port); | 493 | pnp_register_port_resource(dev, option, port); |
491 | } | 494 | } |
492 | 495 | ||
493 | /* | 496 | /* |
494 | * Add fixed port resource to resources list. | 497 | * Add fixed port resource to resources list. |
495 | */ | 498 | */ |
496 | static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option, | 499 | static void __init isapnp_parse_fixed_port_resource(struct pnp_dev *dev, |
500 | struct pnp_option *option, | ||
497 | int size) | 501 | int size) |
498 | { | 502 | { |
499 | unsigned char tmp[3]; | 503 | unsigned char tmp[3]; |
@@ -507,13 +511,14 @@ static void __init isapnp_parse_fixed_port_resource(struct pnp_option *option, | |||
507 | port->size = tmp[2]; | 511 | port->size = tmp[2]; |
508 | port->align = 0; | 512 | port->align = 0; |
509 | port->flags = PNP_PORT_FLAG_FIXED; | 513 | port->flags = PNP_PORT_FLAG_FIXED; |
510 | pnp_register_port_resource(option, port); | 514 | pnp_register_port_resource(dev, option, port); |
511 | } | 515 | } |
512 | 516 | ||
513 | /* | 517 | /* |
514 | * Add memory resource to resources list. | 518 | * Add memory resource to resources list. |
515 | */ | 519 | */ |
516 | static void __init isapnp_parse_mem_resource(struct pnp_option *option, | 520 | static void __init isapnp_parse_mem_resource(struct pnp_dev *dev, |
521 | struct pnp_option *option, | ||
517 | int size) | 522 | int size) |
518 | { | 523 | { |
519 | unsigned char tmp[9]; | 524 | unsigned char tmp[9]; |
@@ -528,13 +533,14 @@ static void __init isapnp_parse_mem_resource(struct pnp_option *option, | |||
528 | mem->align = (tmp[6] << 8) | tmp[5]; | 533 | mem->align = (tmp[6] << 8) | tmp[5]; |
529 | mem->size = ((tmp[8] << 8) | tmp[7]) << 8; | 534 | mem->size = ((tmp[8] << 8) | tmp[7]) << 8; |
530 | mem->flags = tmp[0]; | 535 | mem->flags = tmp[0]; |
531 | pnp_register_mem_resource(option, mem); | 536 | pnp_register_mem_resource(dev, option, mem); |
532 | } | 537 | } |
533 | 538 | ||
534 | /* | 539 | /* |
535 | * Add 32-bit memory resource to resources list. | 540 | * Add 32-bit memory resource to resources list. |
536 | */ | 541 | */ |
537 | static void __init isapnp_parse_mem32_resource(struct pnp_option *option, | 542 | static void __init isapnp_parse_mem32_resource(struct pnp_dev *dev, |
543 | struct pnp_option *option, | ||
538 | int size) | 544 | int size) |
539 | { | 545 | { |
540 | unsigned char tmp[17]; | 546 | unsigned char tmp[17]; |
@@ -551,13 +557,14 @@ static void __init isapnp_parse_mem32_resource(struct pnp_option *option, | |||
551 | mem->size = | 557 | mem->size = |
552 | (tmp[16] << 24) | (tmp[15] << 16) | (tmp[14] << 8) | tmp[13]; | 558 | (tmp[16] << 24) | (tmp[15] << 16) | (tmp[14] << 8) | tmp[13]; |
553 | mem->flags = tmp[0]; | 559 | mem->flags = tmp[0]; |
554 | pnp_register_mem_resource(option, mem); | 560 | pnp_register_mem_resource(dev, option, mem); |
555 | } | 561 | } |
556 | 562 | ||
557 | /* | 563 | /* |
558 | * Add 32-bit fixed memory resource to resources list. | 564 | * Add 32-bit fixed memory resource to resources list. |
559 | */ | 565 | */ |
560 | static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option, | 566 | static void __init isapnp_parse_fixed_mem32_resource(struct pnp_dev *dev, |
567 | struct pnp_option *option, | ||
561 | int size) | 568 | int size) |
562 | { | 569 | { |
563 | unsigned char tmp[9]; | 570 | unsigned char tmp[9]; |
@@ -572,7 +579,7 @@ static void __init isapnp_parse_fixed_mem32_resource(struct pnp_option *option, | |||
572 | mem->size = (tmp[8] << 24) | (tmp[7] << 16) | (tmp[6] << 8) | tmp[5]; | 579 | mem->size = (tmp[8] << 24) | (tmp[7] << 16) | (tmp[6] << 8) | tmp[5]; |
573 | mem->align = 0; | 580 | mem->align = 0; |
574 | mem->flags = tmp[0]; | 581 | mem->flags = tmp[0]; |
575 | pnp_register_mem_resource(option, mem); | 582 | pnp_register_mem_resource(dev, option, mem); |
576 | } | 583 | } |
577 | 584 | ||
578 | /* | 585 | /* |
@@ -656,13 +663,13 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
656 | case _STAG_IRQ: | 663 | case _STAG_IRQ: |
657 | if (size < 2 || size > 3) | 664 | if (size < 2 || size > 3) |
658 | goto __skip; | 665 | goto __skip; |
659 | isapnp_parse_irq_resource(option, size); | 666 | isapnp_parse_irq_resource(dev, option, size); |
660 | size = 0; | 667 | size = 0; |
661 | break; | 668 | break; |
662 | case _STAG_DMA: | 669 | case _STAG_DMA: |
663 | if (size != 2) | 670 | if (size != 2) |
664 | goto __skip; | 671 | goto __skip; |
665 | isapnp_parse_dma_resource(option, size); | 672 | isapnp_parse_dma_resource(dev, option, size); |
666 | size = 0; | 673 | size = 0; |
667 | break; | 674 | break; |
668 | case _STAG_STARTDEP: | 675 | case _STAG_STARTDEP: |
@@ -682,17 +689,18 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
682 | if (size != 0) | 689 | if (size != 0) |
683 | goto __skip; | 690 | goto __skip; |
684 | priority = 0; | 691 | priority = 0; |
692 | dev_dbg(&dev->dev, "end dependent options\n"); | ||
685 | break; | 693 | break; |
686 | case _STAG_IOPORT: | 694 | case _STAG_IOPORT: |
687 | if (size != 7) | 695 | if (size != 7) |
688 | goto __skip; | 696 | goto __skip; |
689 | isapnp_parse_port_resource(option, size); | 697 | isapnp_parse_port_resource(dev, option, size); |
690 | size = 0; | 698 | size = 0; |
691 | break; | 699 | break; |
692 | case _STAG_FIXEDIO: | 700 | case _STAG_FIXEDIO: |
693 | if (size != 3) | 701 | if (size != 3) |
694 | goto __skip; | 702 | goto __skip; |
695 | isapnp_parse_fixed_port_resource(option, size); | 703 | isapnp_parse_fixed_port_resource(dev, option, size); |
696 | size = 0; | 704 | size = 0; |
697 | break; | 705 | break; |
698 | case _STAG_VENDOR: | 706 | case _STAG_VENDOR: |
@@ -700,7 +708,7 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
700 | case _LTAG_MEMRANGE: | 708 | case _LTAG_MEMRANGE: |
701 | if (size != 9) | 709 | if (size != 9) |
702 | goto __skip; | 710 | goto __skip; |
703 | isapnp_parse_mem_resource(option, size); | 711 | isapnp_parse_mem_resource(dev, option, size); |
704 | size = 0; | 712 | size = 0; |
705 | break; | 713 | break; |
706 | case _LTAG_ANSISTR: | 714 | case _LTAG_ANSISTR: |
@@ -715,13 +723,13 @@ static int __init isapnp_create_device(struct pnp_card *card, | |||
715 | case _LTAG_MEM32RANGE: | 723 | case _LTAG_MEM32RANGE: |
716 | if (size != 17) | 724 | if (size != 17) |
717 | goto __skip; | 725 | goto __skip; |
718 | isapnp_parse_mem32_resource(option, size); | 726 | isapnp_parse_mem32_resource(dev, option, size); |
719 | size = 0; | 727 | size = 0; |
720 | break; | 728 | break; |
721 | case _LTAG_FIXEDMEM32RANGE: | 729 | case _LTAG_FIXEDMEM32RANGE: |
722 | if (size != 9) | 730 | if (size != 9) |
723 | goto __skip; | 731 | goto __skip; |
724 | isapnp_parse_fixed_mem32_resource(option, size); | 732 | isapnp_parse_fixed_mem32_resource(dev, option, size); |
725 | size = 0; | 733 | size = 0; |
726 | break; | 734 | break; |
727 | case _STAG_END: | 735 | case _STAG_END: |