diff options
Diffstat (limited to 'drivers/parisc')
-rw-r--r-- | drivers/parisc/ccio-dma.c | 6 | ||||
-rw-r--r-- | drivers/parisc/hppb.c | 2 | ||||
-rw-r--r-- | drivers/parisc/iommu-helpers.h | 7 | ||||
-rw-r--r-- | drivers/parisc/lba_pci.c | 10 | ||||
-rw-r--r-- | drivers/parisc/led.c | 2 | ||||
-rw-r--r-- | drivers/parisc/pdc_stable.c | 194 | ||||
-rw-r--r-- | drivers/parisc/sba_iommu.c | 2 |
7 files changed, 115 insertions, 108 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 7c60cbd85dc8..d08b284de196 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
@@ -363,7 +363,7 @@ ccio_alloc_range(struct ioc *ioc, size_t size) | |||
363 | if (pages_needed <= 8) { | 363 | if (pages_needed <= 8) { |
364 | /* | 364 | /* |
365 | * LAN traffic will not thrash the TLB IFF the same NIC | 365 | * LAN traffic will not thrash the TLB IFF the same NIC |
366 | * uses 8 adjacent pages to map seperate payload data. | 366 | * uses 8 adjacent pages to map separate payload data. |
367 | * ie the same byte in the resource bit map. | 367 | * ie the same byte in the resource bit map. |
368 | */ | 368 | */ |
369 | #if 0 | 369 | #if 0 |
@@ -941,7 +941,7 @@ ccio_map_sg(struct device *dev, struct scatterlist *sglist, int nents, | |||
941 | ** w/o this association, we wouldn't have coherent DMA! | 941 | ** w/o this association, we wouldn't have coherent DMA! |
942 | ** Access to the virtual address is what forces a two pass algorithm. | 942 | ** Access to the virtual address is what forces a two pass algorithm. |
943 | */ | 943 | */ |
944 | coalesced = iommu_coalesce_chunks(ioc, sglist, nents, ccio_alloc_range); | 944 | coalesced = iommu_coalesce_chunks(ioc, dev, sglist, nents, ccio_alloc_range); |
945 | 945 | ||
946 | /* | 946 | /* |
947 | ** Program the I/O Pdir | 947 | ** Program the I/O Pdir |
@@ -1589,7 +1589,7 @@ static int __init ccio_probe(struct parisc_device *dev) | |||
1589 | } | 1589 | } |
1590 | 1590 | ||
1591 | /** | 1591 | /** |
1592 | * ccio_init - ccio initalization procedure. | 1592 | * ccio_init - ccio initialization procedure. |
1593 | * | 1593 | * |
1594 | * Register this driver. | 1594 | * Register this driver. |
1595 | */ | 1595 | */ |
diff --git a/drivers/parisc/hppb.c b/drivers/parisc/hppb.c index a728a7cd2fc8..65eee67aa2ae 100644 --- a/drivers/parisc/hppb.c +++ b/drivers/parisc/hppb.c | |||
@@ -95,7 +95,7 @@ static struct parisc_driver hppb_driver = { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | /** | 97 | /** |
98 | * hppb_init - HP-PB bus initalization procedure. | 98 | * hppb_init - HP-PB bus initialization procedure. |
99 | * | 99 | * |
100 | * Register this driver. | 100 | * Register this driver. |
101 | */ | 101 | */ |
diff --git a/drivers/parisc/iommu-helpers.h b/drivers/parisc/iommu-helpers.h index 0a1f99a2e93e..97ba8286c596 100644 --- a/drivers/parisc/iommu-helpers.h +++ b/drivers/parisc/iommu-helpers.h | |||
@@ -95,12 +95,14 @@ iommu_fill_pdir(struct ioc *ioc, struct scatterlist *startsg, int nents, | |||
95 | */ | 95 | */ |
96 | 96 | ||
97 | static inline unsigned int | 97 | static inline unsigned int |
98 | iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, | 98 | iommu_coalesce_chunks(struct ioc *ioc, struct device *dev, |
99 | struct scatterlist *startsg, int nents, | ||
99 | int (*iommu_alloc_range)(struct ioc *, size_t)) | 100 | int (*iommu_alloc_range)(struct ioc *, size_t)) |
100 | { | 101 | { |
101 | struct scatterlist *contig_sg; /* contig chunk head */ | 102 | struct scatterlist *contig_sg; /* contig chunk head */ |
102 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ | 103 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ |
103 | unsigned int n_mappings = 0; | 104 | unsigned int n_mappings = 0; |
105 | unsigned int max_seg_size = dma_get_max_seg_size(dev); | ||
104 | 106 | ||
105 | while (nents > 0) { | 107 | while (nents > 0) { |
106 | 108 | ||
@@ -142,6 +144,9 @@ iommu_coalesce_chunks(struct ioc *ioc, struct scatterlist *startsg, int nents, | |||
142 | IOVP_SIZE) > DMA_CHUNK_SIZE)) | 144 | IOVP_SIZE) > DMA_CHUNK_SIZE)) |
143 | break; | 145 | break; |
144 | 146 | ||
147 | if (startsg->length + dma_len > max_seg_size) | ||
148 | break; | ||
149 | |||
145 | /* | 150 | /* |
146 | ** Next see if we can append the next chunk (i.e. | 151 | ** Next see if we can append the next chunk (i.e. |
147 | ** it must end on one page and begin on another | 152 | ** it must end on one page and begin on another |
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 5eace9e66e14..66ce61048361 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -768,9 +768,13 @@ lba_fixup_bus(struct pci_bus *bus) | |||
768 | DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX", | 768 | DBG("lba_fixup_bus() WTF? 0x%lx [%lx/%lx] XXX", |
769 | res->flags, res->start, res->end); | 769 | res->flags, res->start, res->end); |
770 | } | 770 | } |
771 | if ((i != PCI_ROM_RESOURCE) || | 771 | |
772 | (res->flags & IORESOURCE_ROM_ENABLE)) | 772 | /* |
773 | pci_claim_resource(dev, i); | 773 | ** FIXME: this will result in whinging for devices |
774 | ** that share expansion ROMs (think quad tulip), but | ||
775 | ** isn't harmful. | ||
776 | */ | ||
777 | pci_claim_resource(dev, i); | ||
774 | } | 778 | } |
775 | 779 | ||
776 | #ifdef FBB_SUPPORT | 780 | #ifdef FBB_SUPPORT |
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index a6d6b2488ffc..703b85edb004 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
@@ -364,7 +364,7 @@ static __inline__ int led_get_net_activity(void) | |||
364 | struct in_device *in_dev = __in_dev_get_rcu(dev); | 364 | struct in_device *in_dev = __in_dev_get_rcu(dev); |
365 | if (!in_dev || !in_dev->ifa_list) | 365 | if (!in_dev || !in_dev->ifa_list) |
366 | continue; | 366 | continue; |
367 | if (LOOPBACK(in_dev->ifa_list->ifa_local)) | 367 | if (ipv4_is_loopback(in_dev->ifa_list->ifa_local)) |
368 | continue; | 368 | continue; |
369 | stats = dev->get_stats(dev); | 369 | stats = dev->get_stats(dev); |
370 | rx_total += stats->rx_packets; | 370 | rx_total += stats->rx_packets; |
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index ebb09e98d215..de34aa9d3136 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c | |||
@@ -120,7 +120,7 @@ struct pdcspath_entry pdcspath_entry_##_name = { \ | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | #define PDCS_ATTR(_name, _mode, _show, _store) \ | 122 | #define PDCS_ATTR(_name, _mode, _show, _store) \ |
123 | struct subsys_attribute pdcs_attr_##_name = { \ | 123 | struct kobj_attribute pdcs_attr_##_name = { \ |
124 | .attr = {.name = __stringify(_name), .mode = _mode}, \ | 124 | .attr = {.name = __stringify(_name), .mode = _mode}, \ |
125 | .show = _show, \ | 125 | .show = _show, \ |
126 | .store = _store, \ | 126 | .store = _store, \ |
@@ -523,15 +523,15 @@ static struct pdcspath_entry *pdcspath_entries[] = { | |||
523 | 523 | ||
524 | /** | 524 | /** |
525 | * pdcs_size_read - Stable Storage size output. | 525 | * pdcs_size_read - Stable Storage size output. |
526 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
527 | * @buf: The output buffer to write to. | 526 | * @buf: The output buffer to write to. |
528 | */ | 527 | */ |
529 | static ssize_t | 528 | static ssize_t pdcs_size_read(struct kobject *kobj, |
530 | pdcs_size_read(struct kset *kset, char *buf) | 529 | struct kobj_attribute *attr, |
530 | char *buf) | ||
531 | { | 531 | { |
532 | char *out = buf; | 532 | char *out = buf; |
533 | 533 | ||
534 | if (!kset || !buf) | 534 | if (!buf) |
535 | return -EINVAL; | 535 | return -EINVAL; |
536 | 536 | ||
537 | /* show the size of the stable storage */ | 537 | /* show the size of the stable storage */ |
@@ -542,17 +542,17 @@ pdcs_size_read(struct kset *kset, char *buf) | |||
542 | 542 | ||
543 | /** | 543 | /** |
544 | * pdcs_auto_read - Stable Storage autoboot/search flag output. | 544 | * pdcs_auto_read - Stable Storage autoboot/search flag output. |
545 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
546 | * @buf: The output buffer to write to. | 545 | * @buf: The output buffer to write to. |
547 | * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag | 546 | * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag |
548 | */ | 547 | */ |
549 | static ssize_t | 548 | static ssize_t pdcs_auto_read(struct kobject *kobj, |
550 | pdcs_auto_read(struct kset *kset, char *buf, int knob) | 549 | struct kobj_attribute *attr, |
550 | char *buf, int knob) | ||
551 | { | 551 | { |
552 | char *out = buf; | 552 | char *out = buf; |
553 | struct pdcspath_entry *pathentry; | 553 | struct pdcspath_entry *pathentry; |
554 | 554 | ||
555 | if (!kset || !buf) | 555 | if (!buf) |
556 | return -EINVAL; | 556 | return -EINVAL; |
557 | 557 | ||
558 | /* Current flags are stored in primary boot path entry */ | 558 | /* Current flags are stored in primary boot path entry */ |
@@ -568,40 +568,37 @@ pdcs_auto_read(struct kset *kset, char *buf, int knob) | |||
568 | 568 | ||
569 | /** | 569 | /** |
570 | * pdcs_autoboot_read - Stable Storage autoboot flag output. | 570 | * pdcs_autoboot_read - Stable Storage autoboot flag output. |
571 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
572 | * @buf: The output buffer to write to. | 571 | * @buf: The output buffer to write to. |
573 | */ | 572 | */ |
574 | static inline ssize_t | 573 | static ssize_t pdcs_autoboot_read(struct kobject *kobj, |
575 | pdcs_autoboot_read(struct kset *kset, char *buf) | 574 | struct kobj_attribute *attr, char *buf) |
576 | { | 575 | { |
577 | return pdcs_auto_read(kset, buf, PF_AUTOBOOT); | 576 | return pdcs_auto_read(kobj, attr, buf, PF_AUTOBOOT); |
578 | } | 577 | } |
579 | 578 | ||
580 | /** | 579 | /** |
581 | * pdcs_autosearch_read - Stable Storage autoboot flag output. | 580 | * pdcs_autosearch_read - Stable Storage autoboot flag output. |
582 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
583 | * @buf: The output buffer to write to. | 581 | * @buf: The output buffer to write to. |
584 | */ | 582 | */ |
585 | static inline ssize_t | 583 | static ssize_t pdcs_autosearch_read(struct kobject *kobj, |
586 | pdcs_autosearch_read(struct kset *kset, char *buf) | 584 | struct kobj_attribute *attr, char *buf) |
587 | { | 585 | { |
588 | return pdcs_auto_read(kset, buf, PF_AUTOSEARCH); | 586 | return pdcs_auto_read(kobj, attr, buf, PF_AUTOSEARCH); |
589 | } | 587 | } |
590 | 588 | ||
591 | /** | 589 | /** |
592 | * pdcs_timer_read - Stable Storage timer count output (in seconds). | 590 | * pdcs_timer_read - Stable Storage timer count output (in seconds). |
593 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
594 | * @buf: The output buffer to write to. | 591 | * @buf: The output buffer to write to. |
595 | * | 592 | * |
596 | * The value of the timer field correponds to a number of seconds in powers of 2. | 593 | * The value of the timer field correponds to a number of seconds in powers of 2. |
597 | */ | 594 | */ |
598 | static ssize_t | 595 | static ssize_t pdcs_timer_read(struct kobject *kobj, |
599 | pdcs_timer_read(struct kset *kset, char *buf) | 596 | struct kobj_attribute *attr, char *buf) |
600 | { | 597 | { |
601 | char *out = buf; | 598 | char *out = buf; |
602 | struct pdcspath_entry *pathentry; | 599 | struct pdcspath_entry *pathentry; |
603 | 600 | ||
604 | if (!kset || !buf) | 601 | if (!buf) |
605 | return -EINVAL; | 602 | return -EINVAL; |
606 | 603 | ||
607 | /* Current flags are stored in primary boot path entry */ | 604 | /* Current flags are stored in primary boot path entry */ |
@@ -618,15 +615,14 @@ pdcs_timer_read(struct kset *kset, char *buf) | |||
618 | 615 | ||
619 | /** | 616 | /** |
620 | * pdcs_osid_read - Stable Storage OS ID register output. | 617 | * pdcs_osid_read - Stable Storage OS ID register output. |
621 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
622 | * @buf: The output buffer to write to. | 618 | * @buf: The output buffer to write to. |
623 | */ | 619 | */ |
624 | static ssize_t | 620 | static ssize_t pdcs_osid_read(struct kobject *kobj, |
625 | pdcs_osid_read(struct kset *kset, char *buf) | 621 | struct kobj_attribute *attr, char *buf) |
626 | { | 622 | { |
627 | char *out = buf; | 623 | char *out = buf; |
628 | 624 | ||
629 | if (!kset || !buf) | 625 | if (!buf) |
630 | return -EINVAL; | 626 | return -EINVAL; |
631 | 627 | ||
632 | out += sprintf(out, "%s dependent data (0x%.4x)\n", | 628 | out += sprintf(out, "%s dependent data (0x%.4x)\n", |
@@ -637,18 +633,17 @@ pdcs_osid_read(struct kset *kset, char *buf) | |||
637 | 633 | ||
638 | /** | 634 | /** |
639 | * pdcs_osdep1_read - Stable Storage OS-Dependent data area 1 output. | 635 | * pdcs_osdep1_read - Stable Storage OS-Dependent data area 1 output. |
640 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
641 | * @buf: The output buffer to write to. | 636 | * @buf: The output buffer to write to. |
642 | * | 637 | * |
643 | * This can hold 16 bytes of OS-Dependent data. | 638 | * This can hold 16 bytes of OS-Dependent data. |
644 | */ | 639 | */ |
645 | static ssize_t | 640 | static ssize_t pdcs_osdep1_read(struct kobject *kobj, |
646 | pdcs_osdep1_read(struct kset *kset, char *buf) | 641 | struct kobj_attribute *attr, char *buf) |
647 | { | 642 | { |
648 | char *out = buf; | 643 | char *out = buf; |
649 | u32 result[4]; | 644 | u32 result[4]; |
650 | 645 | ||
651 | if (!kset || !buf) | 646 | if (!buf) |
652 | return -EINVAL; | 647 | return -EINVAL; |
653 | 648 | ||
654 | if (pdc_stable_read(PDCS_ADDR_OSD1, &result, sizeof(result)) != PDC_OK) | 649 | if (pdc_stable_read(PDCS_ADDR_OSD1, &result, sizeof(result)) != PDC_OK) |
@@ -664,18 +659,17 @@ pdcs_osdep1_read(struct kset *kset, char *buf) | |||
664 | 659 | ||
665 | /** | 660 | /** |
666 | * pdcs_diagnostic_read - Stable Storage Diagnostic register output. | 661 | * pdcs_diagnostic_read - Stable Storage Diagnostic register output. |
667 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
668 | * @buf: The output buffer to write to. | 662 | * @buf: The output buffer to write to. |
669 | * | 663 | * |
670 | * I have NFC how to interpret the content of that register ;-). | 664 | * I have NFC how to interpret the content of that register ;-). |
671 | */ | 665 | */ |
672 | static ssize_t | 666 | static ssize_t pdcs_diagnostic_read(struct kobject *kobj, |
673 | pdcs_diagnostic_read(struct kset *kset, char *buf) | 667 | struct kobj_attribute *attr, char *buf) |
674 | { | 668 | { |
675 | char *out = buf; | 669 | char *out = buf; |
676 | u32 result; | 670 | u32 result; |
677 | 671 | ||
678 | if (!kset || !buf) | 672 | if (!buf) |
679 | return -EINVAL; | 673 | return -EINVAL; |
680 | 674 | ||
681 | /* get diagnostic */ | 675 | /* get diagnostic */ |
@@ -689,18 +683,17 @@ pdcs_diagnostic_read(struct kset *kset, char *buf) | |||
689 | 683 | ||
690 | /** | 684 | /** |
691 | * pdcs_fastsize_read - Stable Storage FastSize register output. | 685 | * pdcs_fastsize_read - Stable Storage FastSize register output. |
692 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
693 | * @buf: The output buffer to write to. | 686 | * @buf: The output buffer to write to. |
694 | * | 687 | * |
695 | * This register holds the amount of system RAM to be tested during boot sequence. | 688 | * This register holds the amount of system RAM to be tested during boot sequence. |
696 | */ | 689 | */ |
697 | static ssize_t | 690 | static ssize_t pdcs_fastsize_read(struct kobject *kobj, |
698 | pdcs_fastsize_read(struct kset *kset, char *buf) | 691 | struct kobj_attribute *attr, char *buf) |
699 | { | 692 | { |
700 | char *out = buf; | 693 | char *out = buf; |
701 | u32 result; | 694 | u32 result; |
702 | 695 | ||
703 | if (!kset || !buf) | 696 | if (!buf) |
704 | return -EINVAL; | 697 | return -EINVAL; |
705 | 698 | ||
706 | /* get fast-size */ | 699 | /* get fast-size */ |
@@ -718,13 +711,12 @@ pdcs_fastsize_read(struct kset *kset, char *buf) | |||
718 | 711 | ||
719 | /** | 712 | /** |
720 | * pdcs_osdep2_read - Stable Storage OS-Dependent data area 2 output. | 713 | * pdcs_osdep2_read - Stable Storage OS-Dependent data area 2 output. |
721 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
722 | * @buf: The output buffer to write to. | 714 | * @buf: The output buffer to write to. |
723 | * | 715 | * |
724 | * This can hold pdcs_size - 224 bytes of OS-Dependent data, when available. | 716 | * This can hold pdcs_size - 224 bytes of OS-Dependent data, when available. |
725 | */ | 717 | */ |
726 | static ssize_t | 718 | static ssize_t pdcs_osdep2_read(struct kobject *kobj, |
727 | pdcs_osdep2_read(struct kset *kset, char *buf) | 719 | struct kobj_attribute *attr, char *buf) |
728 | { | 720 | { |
729 | char *out = buf; | 721 | char *out = buf; |
730 | unsigned long size; | 722 | unsigned long size; |
@@ -736,7 +728,7 @@ pdcs_osdep2_read(struct kset *kset, char *buf) | |||
736 | 728 | ||
737 | size = pdcs_size - 224; | 729 | size = pdcs_size - 224; |
738 | 730 | ||
739 | if (!kset || !buf) | 731 | if (!buf) |
740 | return -EINVAL; | 732 | return -EINVAL; |
741 | 733 | ||
742 | for (i=0; i<size; i+=4) { | 734 | for (i=0; i<size; i+=4) { |
@@ -751,7 +743,6 @@ pdcs_osdep2_read(struct kset *kset, char *buf) | |||
751 | 743 | ||
752 | /** | 744 | /** |
753 | * pdcs_auto_write - This function handles autoboot/search flag modifying. | 745 | * pdcs_auto_write - This function handles autoboot/search flag modifying. |
754 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
755 | * @buf: The input buffer to read from. | 746 | * @buf: The input buffer to read from. |
756 | * @count: The number of bytes to be read. | 747 | * @count: The number of bytes to be read. |
757 | * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag | 748 | * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag |
@@ -760,8 +751,9 @@ pdcs_osdep2_read(struct kset *kset, char *buf) | |||
760 | * We expect a precise syntax: | 751 | * We expect a precise syntax: |
761 | * \"n\" (n == 0 or 1) to toggle AutoBoot Off or On | 752 | * \"n\" (n == 0 or 1) to toggle AutoBoot Off or On |
762 | */ | 753 | */ |
763 | static ssize_t | 754 | static ssize_t pdcs_auto_write(struct kobject *kobj, |
764 | pdcs_auto_write(struct kset *kset, const char *buf, size_t count, int knob) | 755 | struct kobj_attribute *attr, const char *buf, |
756 | size_t count, int knob) | ||
765 | { | 757 | { |
766 | struct pdcspath_entry *pathentry; | 758 | struct pdcspath_entry *pathentry; |
767 | unsigned char flags; | 759 | unsigned char flags; |
@@ -771,7 +763,7 @@ pdcs_auto_write(struct kset *kset, const char *buf, size_t count, int knob) | |||
771 | if (!capable(CAP_SYS_ADMIN)) | 763 | if (!capable(CAP_SYS_ADMIN)) |
772 | return -EACCES; | 764 | return -EACCES; |
773 | 765 | ||
774 | if (!kset || !buf || !count) | 766 | if (!buf || !count) |
775 | return -EINVAL; | 767 | return -EINVAL; |
776 | 768 | ||
777 | /* We'll use a local copy of buf */ | 769 | /* We'll use a local copy of buf */ |
@@ -826,7 +818,6 @@ parse_error: | |||
826 | 818 | ||
827 | /** | 819 | /** |
828 | * pdcs_autoboot_write - This function handles autoboot flag modifying. | 820 | * pdcs_autoboot_write - This function handles autoboot flag modifying. |
829 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
830 | * @buf: The input buffer to read from. | 821 | * @buf: The input buffer to read from. |
831 | * @count: The number of bytes to be read. | 822 | * @count: The number of bytes to be read. |
832 | * | 823 | * |
@@ -834,15 +825,15 @@ parse_error: | |||
834 | * We expect a precise syntax: | 825 | * We expect a precise syntax: |
835 | * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On | 826 | * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On |
836 | */ | 827 | */ |
837 | static inline ssize_t | 828 | static ssize_t pdcs_autoboot_write(struct kobject *kobj, |
838 | pdcs_autoboot_write(struct kset *kset, const char *buf, size_t count) | 829 | struct kobj_attribute *attr, |
830 | const char *buf, size_t count) | ||
839 | { | 831 | { |
840 | return pdcs_auto_write(kset, buf, count, PF_AUTOBOOT); | 832 | return pdcs_auto_write(kset, attr, buf, count, PF_AUTOBOOT); |
841 | } | 833 | } |
842 | 834 | ||
843 | /** | 835 | /** |
844 | * pdcs_autosearch_write - This function handles autosearch flag modifying. | 836 | * pdcs_autosearch_write - This function handles autosearch flag modifying. |
845 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
846 | * @buf: The input buffer to read from. | 837 | * @buf: The input buffer to read from. |
847 | * @count: The number of bytes to be read. | 838 | * @count: The number of bytes to be read. |
848 | * | 839 | * |
@@ -850,15 +841,15 @@ pdcs_autoboot_write(struct kset *kset, const char *buf, size_t count) | |||
850 | * We expect a precise syntax: | 841 | * We expect a precise syntax: |
851 | * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On | 842 | * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On |
852 | */ | 843 | */ |
853 | static inline ssize_t | 844 | static ssize_t pdcs_autosearch_write(struct kobject *kobj, |
854 | pdcs_autosearch_write(struct kset *kset, const char *buf, size_t count) | 845 | struct kobj_attribute *attr, |
846 | const char *buf, size_t count) | ||
855 | { | 847 | { |
856 | return pdcs_auto_write(kset, buf, count, PF_AUTOSEARCH); | 848 | return pdcs_auto_write(kset, attr, buf, count, PF_AUTOSEARCH); |
857 | } | 849 | } |
858 | 850 | ||
859 | /** | 851 | /** |
860 | * pdcs_osdep1_write - Stable Storage OS-Dependent data area 1 input. | 852 | * pdcs_osdep1_write - Stable Storage OS-Dependent data area 1 input. |
861 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
862 | * @buf: The input buffer to read from. | 853 | * @buf: The input buffer to read from. |
863 | * @count: The number of bytes to be read. | 854 | * @count: The number of bytes to be read. |
864 | * | 855 | * |
@@ -866,15 +857,16 @@ pdcs_autosearch_write(struct kset *kset, const char *buf, size_t count) | |||
866 | * write approach. It's up to userspace to deal with it when constructing | 857 | * write approach. It's up to userspace to deal with it when constructing |
867 | * its input buffer. | 858 | * its input buffer. |
868 | */ | 859 | */ |
869 | static ssize_t | 860 | static ssize_t pdcs_osdep1_write(struct kobject *kobj, |
870 | pdcs_osdep1_write(struct kset *kset, const char *buf, size_t count) | 861 | struct kobj_attribute *attr, |
862 | const char *buf, size_t count) | ||
871 | { | 863 | { |
872 | u8 in[16]; | 864 | u8 in[16]; |
873 | 865 | ||
874 | if (!capable(CAP_SYS_ADMIN)) | 866 | if (!capable(CAP_SYS_ADMIN)) |
875 | return -EACCES; | 867 | return -EACCES; |
876 | 868 | ||
877 | if (!kset || !buf || !count) | 869 | if (!buf || !count) |
878 | return -EINVAL; | 870 | return -EINVAL; |
879 | 871 | ||
880 | if (unlikely(pdcs_osid != OS_ID_LINUX)) | 872 | if (unlikely(pdcs_osid != OS_ID_LINUX)) |
@@ -895,7 +887,6 @@ pdcs_osdep1_write(struct kset *kset, const char *buf, size_t count) | |||
895 | 887 | ||
896 | /** | 888 | /** |
897 | * pdcs_osdep2_write - Stable Storage OS-Dependent data area 2 input. | 889 | * pdcs_osdep2_write - Stable Storage OS-Dependent data area 2 input. |
898 | * @kset: An allocated and populated struct kset. We don't use it tho. | ||
899 | * @buf: The input buffer to read from. | 890 | * @buf: The input buffer to read from. |
900 | * @count: The number of bytes to be read. | 891 | * @count: The number of bytes to be read. |
901 | * | 892 | * |
@@ -903,8 +894,9 @@ pdcs_osdep1_write(struct kset *kset, const char *buf, size_t count) | |||
903 | * byte-by-byte write approach. It's up to userspace to deal with it when | 894 | * byte-by-byte write approach. It's up to userspace to deal with it when |
904 | * constructing its input buffer. | 895 | * constructing its input buffer. |
905 | */ | 896 | */ |
906 | static ssize_t | 897 | static ssize_t pdcs_osdep2_write(struct kobject *kobj, |
907 | pdcs_osdep2_write(struct kset *kset, const char *buf, size_t count) | 898 | struct kobj_attribute *attr, |
899 | const char *buf, size_t count) | ||
908 | { | 900 | { |
909 | unsigned long size; | 901 | unsigned long size; |
910 | unsigned short i; | 902 | unsigned short i; |
@@ -913,7 +905,7 @@ pdcs_osdep2_write(struct kset *kset, const char *buf, size_t count) | |||
913 | if (!capable(CAP_SYS_ADMIN)) | 905 | if (!capable(CAP_SYS_ADMIN)) |
914 | return -EACCES; | 906 | return -EACCES; |
915 | 907 | ||
916 | if (!kset || !buf || !count) | 908 | if (!buf || !count) |
917 | return -EINVAL; | 909 | return -EINVAL; |
918 | 910 | ||
919 | if (unlikely(pdcs_size <= 224)) | 911 | if (unlikely(pdcs_size <= 224)) |
@@ -951,21 +943,25 @@ static PDCS_ATTR(diagnostic, 0400, pdcs_diagnostic_read, NULL); | |||
951 | static PDCS_ATTR(fastsize, 0400, pdcs_fastsize_read, NULL); | 943 | static PDCS_ATTR(fastsize, 0400, pdcs_fastsize_read, NULL); |
952 | static PDCS_ATTR(osdep2, 0600, pdcs_osdep2_read, pdcs_osdep2_write); | 944 | static PDCS_ATTR(osdep2, 0600, pdcs_osdep2_read, pdcs_osdep2_write); |
953 | 945 | ||
954 | static struct subsys_attribute *pdcs_subsys_attrs[] = { | 946 | static struct attribute *pdcs_subsys_attrs[] = { |
955 | &pdcs_attr_size, | 947 | &pdcs_attr_size.attr, |
956 | &pdcs_attr_autoboot, | 948 | &pdcs_attr_autoboot.attr, |
957 | &pdcs_attr_autosearch, | 949 | &pdcs_attr_autosearch.attr, |
958 | &pdcs_attr_timer, | 950 | &pdcs_attr_timer.attr, |
959 | &pdcs_attr_osid, | 951 | &pdcs_attr_osid.attr, |
960 | &pdcs_attr_osdep1, | 952 | &pdcs_attr_osdep1.attr, |
961 | &pdcs_attr_diagnostic, | 953 | &pdcs_attr_diagnostic.attr, |
962 | &pdcs_attr_fastsize, | 954 | &pdcs_attr_fastsize.attr, |
963 | &pdcs_attr_osdep2, | 955 | &pdcs_attr_osdep2.attr, |
964 | NULL, | 956 | NULL, |
965 | }; | 957 | }; |
966 | 958 | ||
967 | static decl_subsys(paths, &ktype_pdcspath, NULL); | 959 | static struct attribute_group pdcs_attr_group = { |
968 | static decl_subsys(stable, NULL, NULL); | 960 | .attrs = pdcs_subsys_attrs, |
961 | }; | ||
962 | |||
963 | static struct kobject *stable_kobj; | ||
964 | static struct kset *paths_kset; | ||
969 | 965 | ||
970 | /** | 966 | /** |
971 | * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. | 967 | * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. |
@@ -995,12 +991,12 @@ pdcs_register_pathentries(void) | |||
995 | if (err < 0) | 991 | if (err < 0) |
996 | continue; | 992 | continue; |
997 | 993 | ||
998 | if ((err = kobject_set_name(&entry->kobj, "%s", entry->name))) | 994 | entry->kobj.kset = paths_kset; |
999 | return err; | 995 | err = kobject_init_and_add(&entry->kobj, &ktype_pdcspath, NULL, |
1000 | kobj_set_kset_s(entry, paths_subsys); | 996 | "%s", entry->name); |
1001 | if ((err = kobject_register(&entry->kobj))) | 997 | if (err) |
1002 | return err; | 998 | return err; |
1003 | 999 | ||
1004 | /* kobject is now registered */ | 1000 | /* kobject is now registered */ |
1005 | write_lock(&entry->rw_lock); | 1001 | write_lock(&entry->rw_lock); |
1006 | entry->ready = 2; | 1002 | entry->ready = 2; |
@@ -1012,6 +1008,7 @@ pdcs_register_pathentries(void) | |||
1012 | } | 1008 | } |
1013 | 1009 | ||
1014 | write_unlock(&entry->rw_lock); | 1010 | write_unlock(&entry->rw_lock); |
1011 | kobject_uevent(&entry->kobj, KOBJ_ADD); | ||
1015 | } | 1012 | } |
1016 | 1013 | ||
1017 | return 0; | 1014 | return 0; |
@@ -1029,7 +1026,7 @@ pdcs_unregister_pathentries(void) | |||
1029 | for (i = 0; (entry = pdcspath_entries[i]); i++) { | 1026 | for (i = 0; (entry = pdcspath_entries[i]); i++) { |
1030 | read_lock(&entry->rw_lock); | 1027 | read_lock(&entry->rw_lock); |
1031 | if (entry->ready >= 2) | 1028 | if (entry->ready >= 2) |
1032 | kobject_unregister(&entry->kobj); | 1029 | kobject_put(&entry->kobj); |
1033 | read_unlock(&entry->rw_lock); | 1030 | read_unlock(&entry->rw_lock); |
1034 | } | 1031 | } |
1035 | } | 1032 | } |
@@ -1041,8 +1038,7 @@ pdcs_unregister_pathentries(void) | |||
1041 | static int __init | 1038 | static int __init |
1042 | pdc_stable_init(void) | 1039 | pdc_stable_init(void) |
1043 | { | 1040 | { |
1044 | struct subsys_attribute *attr; | 1041 | int rc = 0, error = 0; |
1045 | int i, rc = 0, error = 0; | ||
1046 | u32 result; | 1042 | u32 result; |
1047 | 1043 | ||
1048 | /* find the size of the stable storage */ | 1044 | /* find the size of the stable storage */ |
@@ -1062,21 +1058,24 @@ pdc_stable_init(void) | |||
1062 | /* the actual result is 16 bits away */ | 1058 | /* the actual result is 16 bits away */ |
1063 | pdcs_osid = (u16)(result >> 16); | 1059 | pdcs_osid = (u16)(result >> 16); |
1064 | 1060 | ||
1065 | /* For now we'll register the stable subsys within this driver */ | 1061 | /* For now we'll register the directory at /sys/firmware/stable */ |
1066 | if ((rc = firmware_register(&stable_subsys))) | 1062 | stable_kobj = kobject_create_and_add("stable", firmware_kobj); |
1063 | if (!stable_kobj) { | ||
1064 | rc = -ENOMEM; | ||
1067 | goto fail_firmreg; | 1065 | goto fail_firmreg; |
1066 | } | ||
1068 | 1067 | ||
1069 | /* Don't forget the root entries */ | 1068 | /* Don't forget the root entries */ |
1070 | for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++) | 1069 | error = sysfs_create_group(stable_kobj, pdcs_attr_group); |
1071 | if (attr->show) | ||
1072 | error = subsys_create_file(&stable_subsys, attr); | ||
1073 | |||
1074 | /* register the paths subsys as a subsystem of stable subsys */ | ||
1075 | kobj_set_kset_s(&paths_subsys, stable_subsys); | ||
1076 | if ((rc = subsystem_register(&paths_subsys))) | ||
1077 | goto fail_subsysreg; | ||
1078 | 1070 | ||
1079 | /* now we create all "files" for the paths subsys */ | 1071 | /* register the paths kset as a child of the stable kset */ |
1072 | paths_kset = kset_create_and_add("paths", NULL, stable_kobj); | ||
1073 | if (!paths_kset) { | ||
1074 | rc = -ENOMEM; | ||
1075 | goto fail_ksetreg; | ||
1076 | } | ||
1077 | |||
1078 | /* now we create all "files" for the paths kset */ | ||
1080 | if ((rc = pdcs_register_pathentries())) | 1079 | if ((rc = pdcs_register_pathentries())) |
1081 | goto fail_pdcsreg; | 1080 | goto fail_pdcsreg; |
1082 | 1081 | ||
@@ -1084,10 +1083,10 @@ pdc_stable_init(void) | |||
1084 | 1083 | ||
1085 | fail_pdcsreg: | 1084 | fail_pdcsreg: |
1086 | pdcs_unregister_pathentries(); | 1085 | pdcs_unregister_pathentries(); |
1087 | subsystem_unregister(&paths_subsys); | 1086 | kset_unregister(paths_kset); |
1088 | 1087 | ||
1089 | fail_subsysreg: | 1088 | fail_ksetreg: |
1090 | firmware_unregister(&stable_subsys); | 1089 | kobject_put(stable_kobj); |
1091 | 1090 | ||
1092 | fail_firmreg: | 1091 | fail_firmreg: |
1093 | printk(KERN_INFO PDCS_PREFIX " bailing out\n"); | 1092 | printk(KERN_INFO PDCS_PREFIX " bailing out\n"); |
@@ -1098,9 +1097,8 @@ static void __exit | |||
1098 | pdc_stable_exit(void) | 1097 | pdc_stable_exit(void) |
1099 | { | 1098 | { |
1100 | pdcs_unregister_pathentries(); | 1099 | pdcs_unregister_pathentries(); |
1101 | subsystem_unregister(&paths_subsys); | 1100 | kset_unregister(paths_kset); |
1102 | 1101 | kobject_put(stable_kobj); | |
1103 | firmware_unregister(&stable_subsys); | ||
1104 | } | 1102 | } |
1105 | 1103 | ||
1106 | 1104 | ||
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index e527a0e1d6c0..d06627c3f353 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -946,7 +946,7 @@ sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, | |||
946 | ** w/o this association, we wouldn't have coherent DMA! | 946 | ** w/o this association, we wouldn't have coherent DMA! |
947 | ** Access to the virtual address is what forces a two pass algorithm. | 947 | ** Access to the virtual address is what forces a two pass algorithm. |
948 | */ | 948 | */ |
949 | coalesced = iommu_coalesce_chunks(ioc, sglist, nents, sba_alloc_range); | 949 | coalesced = iommu_coalesce_chunks(ioc, dev, sglist, nents, sba_alloc_range); |
950 | 950 | ||
951 | /* | 951 | /* |
952 | ** Program the I/O Pdir | 952 | ** Program the I/O Pdir |