aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/iop.c
diff options
context:
space:
mode:
authorMarkus Lidel <Markus.Lidel@shadowconnect.com>2005-06-24 01:02:23 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:05:29 -0400
commitf33213ecf49c98da4e85121b592c3bea8057c2e6 (patch)
treeda7e51e7204625f21371eac23a931f4fe479e9db /drivers/message/i2o/iop.c
parent9e87545f06930c1d294423a8091d1077e7444a47 (diff)
[PATCH] I2O: Lindent run and replacement of printk through osm printing functions
Lindent run and replaced printk() through the corresponding osm_*() function Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/iop.c')
-rw-r--r--drivers/message/i2o/iop.c128
1 files changed, 58 insertions, 70 deletions
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
index c32022bc2a21..42f8b810d6e5 100644
--- a/drivers/message/i2o/iop.c
+++ b/drivers/message/i2o/iop.c
@@ -117,13 +117,13 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
117 unsigned long flags; 117 unsigned long flags;
118 118
119 if (!ptr) 119 if (!ptr)
120 printk(KERN_ERR "%s: couldn't add NULL pointer to context list!" 120 osm_err("%s: couldn't add NULL pointer to context list!\n",
121 "\n", c->name); 121 c->name);
122 122
123 entry = kmalloc(sizeof(*entry), GFP_ATOMIC); 123 entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
124 if (!entry) { 124 if (!entry) {
125 printk(KERN_ERR "%s: Could not allocate memory for context " 125 osm_err("%s: Could not allocate memory for context list element"
126 "list element\n", c->name); 126 "\n", c->name);
127 return 0; 127 return 0;
128 } 128 }
129 129
@@ -142,7 +142,7 @@ u32 i2o_cntxt_list_add(struct i2o_controller * c, void *ptr)
142 142
143 spin_unlock_irqrestore(&c->context_list_lock, flags); 143 spin_unlock_irqrestore(&c->context_list_lock, flags);
144 144
145 pr_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context); 145 osm_debug("%s: Add context to list %p -> %d\n", c->name, ptr, context);
146 146
147 return entry->context; 147 return entry->context;
148}; 148};
@@ -174,11 +174,11 @@ u32 i2o_cntxt_list_remove(struct i2o_controller * c, void *ptr)
174 spin_unlock_irqrestore(&c->context_list_lock, flags); 174 spin_unlock_irqrestore(&c->context_list_lock, flags);
175 175
176 if (!context) 176 if (!context)
177 printk(KERN_WARNING "%s: Could not remove nonexistent ptr " 177 osm_warn("%s: Could not remove nonexistent ptr %p\n", c->name,
178 "%p\n", c->name, ptr); 178 ptr);
179 179
180 pr_debug("%s: remove ptr from context list %d -> %p\n", c->name, 180 osm_debug("%s: remove ptr from context list %d -> %p\n", c->name,
181 context, ptr); 181 context, ptr);
182 182
183 return context; 183 return context;
184}; 184};
@@ -208,11 +208,10 @@ void *i2o_cntxt_list_get(struct i2o_controller *c, u32 context)
208 spin_unlock_irqrestore(&c->context_list_lock, flags); 208 spin_unlock_irqrestore(&c->context_list_lock, flags);
209 209
210 if (!ptr) 210 if (!ptr)
211 printk(KERN_WARNING "%s: context id %d not found\n", c->name, 211 osm_warn("%s: context id %d not found\n", c->name, context);
212 context);
213 212
214 pr_debug("%s: get ptr from context list %d -> %p\n", c->name, context, 213 osm_debug("%s: get ptr from context list %d -> %p\n", c->name, context,
215 ptr); 214 ptr);
216 215
217 return ptr; 216 return ptr;
218}; 217};
@@ -240,11 +239,11 @@ u32 i2o_cntxt_list_get_ptr(struct i2o_controller * c, void *ptr)
240 spin_unlock_irqrestore(&c->context_list_lock, flags); 239 spin_unlock_irqrestore(&c->context_list_lock, flags);
241 240
242 if (!context) 241 if (!context)
243 printk(KERN_WARNING "%s: Could not find nonexistent ptr " 242 osm_warn("%s: Could not find nonexistent ptr %p\n", c->name,
244 "%p\n", c->name, ptr); 243 ptr);
245 244
246 pr_debug("%s: get context id from context list %p -> %d\n", c->name, 245 osm_debug("%s: get context id from context list %p -> %d\n", c->name,
247 ptr, context); 246 ptr, context);
248 247
249 return context; 248 return context;
250}; 249};
@@ -324,10 +323,9 @@ static int i2o_iop_quiesce(struct i2o_controller *c)
324 323
325 /* Long timeout needed for quiesce if lots of devices */ 324 /* Long timeout needed for quiesce if lots of devices */
326 if ((rc = i2o_msg_post_wait(c, m, 240))) 325 if ((rc = i2o_msg_post_wait(c, m, 240)))
327 printk(KERN_INFO "%s: Unable to quiesce (status=%#x).\n", 326 osm_info("%s: Unable to quiesce (status=%#x).\n", c->name, -rc);
328 c->name, -rc);
329 else 327 else
330 pr_debug("%s: Quiesced.\n", c->name); 328 osm_debug("%s: Quiesced.\n", c->name);
331 329
332 i2o_status_get(c); // Entered READY state 330 i2o_status_get(c); // Entered READY state
333 331
@@ -365,10 +363,9 @@ static int i2o_iop_enable(struct i2o_controller *c)
365 363
366 /* How long of a timeout do we need? */ 364 /* How long of a timeout do we need? */
367 if ((rc = i2o_msg_post_wait(c, m, 240))) 365 if ((rc = i2o_msg_post_wait(c, m, 240)))
368 printk(KERN_ERR "%s: Could not enable (status=%#x).\n", 366 osm_err("%s: Could not enable (status=%#x).\n", c->name, -rc);
369 c->name, -rc);
370 else 367 else
371 pr_debug("%s: Enabled.\n", c->name); 368 osm_debug("%s: Enabled.\n", c->name);
372 369
373 i2o_status_get(c); // entered OPERATIONAL state 370 i2o_status_get(c); // entered OPERATIONAL state
374 371
@@ -432,10 +429,9 @@ static int i2o_iop_clear(struct i2o_controller *c)
432 &msg->u.head[1]); 429 &msg->u.head[1]);
433 430
434 if ((rc = i2o_msg_post_wait(c, m, 30))) 431 if ((rc = i2o_msg_post_wait(c, m, 30)))
435 printk(KERN_INFO "%s: Unable to clear (status=%#x).\n", 432 osm_info("%s: Unable to clear (status=%#x).\n", c->name, -rc);
436 c->name, -rc);
437 else 433 else
438 pr_debug("%s: Cleared.\n", c->name); 434 osm_debug("%s: Cleared.\n", c->name);
439 435
440 /* Enable all IOPs */ 436 /* Enable all IOPs */
441 i2o_iop_enable_all(); 437 i2o_iop_enable_all();
@@ -570,14 +566,13 @@ static int i2o_iop_reset(struct i2o_controller *c)
570 * can't read one in the given ammount of time, we assume the 566 * can't read one in the given ammount of time, we assume the
571 * IOP could not reboot properly. 567 * IOP could not reboot properly.
572 */ 568 */
573 pr_debug("%s: Reset in progress, waiting for reboot...\n", 569 osm_debug("%s: Reset in progress, waiting for reboot...\n",
574 c->name); 570 c->name);
575 571
576 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET); 572 m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_RESET);
577 while (m == I2O_QUEUE_EMPTY) { 573 while (m == I2O_QUEUE_EMPTY) {
578 if (time_after(jiffies, timeout)) { 574 if (time_after(jiffies, timeout)) {
579 printk(KERN_ERR "%s: IOP reset timeout.\n", 575 osm_err("%s: IOP reset timeout.\n", c->name);
580 c->name);
581 rc = -ETIMEDOUT; 576 rc = -ETIMEDOUT;
582 goto exit; 577 goto exit;
583 } 578 }
@@ -635,29 +630,29 @@ static int i2o_iop_activate(struct i2o_controller *c)
635 630
636 rc = i2o_status_get(c); 631 rc = i2o_status_get(c);
637 if (rc) { 632 if (rc) {
638 printk(KERN_INFO "%s: Unable to obtain status, " 633 osm_info("%s: Unable to obtain status, attempting a reset.\n",
639 "attempting a reset.\n", c->name); 634 c->name);
640 rc = i2o_iop_reset(c); 635 rc = i2o_iop_reset(c);
641 if (rc) 636 if (rc)
642 return rc; 637 return rc;
643 } 638 }
644 639
645 if (sb->i2o_version > I2OVER15) { 640 if (sb->i2o_version > I2OVER15) {
646 printk(KERN_ERR "%s: Not running version 1.5 of the I2O " 641 osm_err("%s: Not running version 1.5 of the I2O Specification."
647 "Specification.\n", c->name); 642 "\n", c->name);
648 return -ENODEV; 643 return -ENODEV;
649 } 644 }
650 645
651 switch (sb->iop_state) { 646 switch (sb->iop_state) {
652 case ADAPTER_STATE_FAULTED: 647 case ADAPTER_STATE_FAULTED:
653 printk(KERN_CRIT "%s: hardware fault\n", c->name); 648 osm_err("%s: hardware fault\n", c->name);
654 return -EFAULT; 649 return -EFAULT;
655 650
656 case ADAPTER_STATE_READY: 651 case ADAPTER_STATE_READY:
657 case ADAPTER_STATE_OPERATIONAL: 652 case ADAPTER_STATE_OPERATIONAL:
658 case ADAPTER_STATE_HOLD: 653 case ADAPTER_STATE_HOLD:
659 case ADAPTER_STATE_FAILED: 654 case ADAPTER_STATE_FAILED:
660 pr_debug("%s: already running, trying to reset...\n", c->name); 655 osm_debug("%s: already running, trying to reset...\n", c->name);
661 rc = i2o_iop_reset(c); 656 rc = i2o_iop_reset(c);
662 if (rc) 657 if (rc)
663 return rc; 658 return rc;
@@ -707,20 +702,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
707 res->flags = IORESOURCE_MEM; 702 res->flags = IORESOURCE_MEM;
708 res->start = 0; 703 res->start = 0;
709 res->end = 0; 704 res->end = 0;
710 printk(KERN_INFO "%s: requires private memory resources.\n", 705 osm_info("%s: requires private memory resources.\n", c->name);
711 c->name);
712 root = pci_find_parent_resource(c->pdev, res); 706 root = pci_find_parent_resource(c->pdev, res);
713 if (root == NULL) 707 if (root == NULL)
714 printk(KERN_WARNING "%s: Can't find parent resource!\n", 708 osm_warn("%s: Can't find parent resource!\n", c->name);
715 c->name);
716 if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ 709 if (root && allocate_resource(root, res, sb->desired_mem_size, sb->desired_mem_size, sb->desired_mem_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
717 NULL, NULL) >= 0) { 710 NULL, NULL) >= 0) {
718 c->mem_alloc = 1; 711 c->mem_alloc = 1;
719 sb->current_mem_size = 1 + res->end - res->start; 712 sb->current_mem_size = 1 + res->end - res->start;
720 sb->current_mem_base = res->start; 713 sb->current_mem_base = res->start;
721 printk(KERN_INFO "%s: allocated %ld bytes of PCI memory" 714 osm_info("%s: allocated %ld bytes of PCI memory at "
722 " at 0x%08lX.\n", c->name, 715 "0x%08lX.\n", c->name,
723 1 + res->end - res->start, res->start); 716 1 + res->end - res->start, res->start);
724 } 717 }
725 } 718 }
726 719
@@ -730,20 +723,18 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
730 res->flags = IORESOURCE_IO; 723 res->flags = IORESOURCE_IO;
731 res->start = 0; 724 res->start = 0;
732 res->end = 0; 725 res->end = 0;
733 printk(KERN_INFO "%s: requires private memory resources.\n", 726 osm_info("%s: requires private memory resources.\n", c->name);
734 c->name);
735 root = pci_find_parent_resource(c->pdev, res); 727 root = pci_find_parent_resource(c->pdev, res);
736 if (root == NULL) 728 if (root == NULL)
737 printk(KERN_WARNING "%s: Can't find parent resource!\n", 729 osm_warn("%s: Can't find parent resource!\n", c->name);
738 c->name);
739 if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */ 730 if (root && allocate_resource(root, res, sb->desired_io_size, sb->desired_io_size, sb->desired_io_size, 1 << 20, /* Unspecified, so use 1Mb and play safe */
740 NULL, NULL) >= 0) { 731 NULL, NULL) >= 0) {
741 c->io_alloc = 1; 732 c->io_alloc = 1;
742 sb->current_io_size = 1 + res->end - res->start; 733 sb->current_io_size = 1 + res->end - res->start;
743 sb->current_mem_base = res->start; 734 sb->current_mem_base = res->start;
744 printk(KERN_INFO "%s: allocated %ld bytes of PCI I/O at" 735 osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX"
745 " 0x%08lX.\n", c->name, 736 ".\n", c->name, 1 + res->end - res->start,
746 1 + res->end - res->start, res->start); 737 res->start);
747 } 738 }
748 } 739 }
749 740
@@ -787,10 +778,10 @@ static int i2o_iop_systab_set(struct i2o_controller *c)
787 PCI_DMA_TODEVICE); 778 PCI_DMA_TODEVICE);
788 779
789 if (rc < 0) 780 if (rc < 0)
790 printk(KERN_ERR "%s: Unable to set SysTab (status=%#x).\n", 781 osm_err("%s: Unable to set SysTab (status=%#x).\n", c->name,
791 c->name, -rc); 782 -rc);
792 else 783 else
793 pr_debug("%s: SysTab set.\n", c->name); 784 osm_debug("%s: SysTab set.\n", c->name);
794 785
795 i2o_status_get(c); // Entered READY state 786 i2o_status_get(c); // Entered READY state
796 787
@@ -814,7 +805,7 @@ static int i2o_iop_online(struct i2o_controller *c)
814 return rc; 805 return rc;
815 806
816 /* In READY state */ 807 /* In READY state */
817 pr_debug("%s: Attempting to enable...\n", c->name); 808 osm_debug("%s: Attempting to enable...\n", c->name);
818 rc = i2o_iop_enable(c); 809 rc = i2o_iop_enable(c);
819 if (rc) 810 if (rc)
820 return rc; 811 return rc;
@@ -833,7 +824,7 @@ void i2o_iop_remove(struct i2o_controller *c)
833{ 824{
834 struct i2o_device *dev, *tmp; 825 struct i2o_device *dev, *tmp;
835 826
836 pr_debug("%s: deleting controller\n", c->name); 827 osm_debug("%s: deleting controller\n", c->name);
837 828
838 i2o_driver_notify_controller_remove_all(c); 829 i2o_driver_notify_controller_remove_all(c);
839 830
@@ -882,8 +873,7 @@ static int i2o_systab_build(void)
882 873
883 systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL); 874 systab = i2o_systab.virt = kmalloc(i2o_systab.len, GFP_KERNEL);
884 if (!systab) { 875 if (!systab) {
885 printk(KERN_ERR "i2o: unable to allocate memory for System " 876 osm_err("unable to allocate memory for System Table\n");
886 "Table\n");
887 return -ENOMEM; 877 return -ENOMEM;
888 } 878 }
889 memset(systab, 0, i2o_systab.len); 879 memset(systab, 0, i2o_systab.len);
@@ -895,8 +885,8 @@ static int i2o_systab_build(void)
895 i2o_status_block *sb; 885 i2o_status_block *sb;
896 886
897 if (count >= num_controllers) { 887 if (count >= num_controllers) {
898 printk(KERN_ERR "i2o: controller added while building " 888 osm_err("controller added while building system table"
899 "system table\n"); 889 "\n");
900 break; 890 break;
901 } 891 }
902 892
@@ -910,9 +900,8 @@ static int i2o_systab_build(void)
910 * it is techninically not part of the I2O subsystem... 900 * it is techninically not part of the I2O subsystem...
911 */ 901 */
912 if (unlikely(i2o_status_get(c))) { 902 if (unlikely(i2o_status_get(c))) {
913 printk(KERN_ERR "%s: Deleting b/c could not get status" 903 osm_err("%s: Deleting b/c could not get status while "
914 " while attempting to build system table\n", 904 "attempting to build system table\n", c->name);
915 c->name);
916 i2o_iop_remove(c); 905 i2o_iop_remove(c);
917 continue; // try the next one 906 continue; // try the next one
918 } 907 }
@@ -994,7 +983,7 @@ int i2o_status_get(struct i2o_controller *c)
994 timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ; 983 timeout = jiffies + I2O_TIMEOUT_STATUS_GET * HZ;
995 while (status_block[87] != 0xFF) { 984 while (status_block[87] != 0xFF) {
996 if (time_after(jiffies, timeout)) { 985 if (time_after(jiffies, timeout)) {
997 printk(KERN_ERR "%s: Get status timeout.\n", c->name); 986 osm_err("%s: Get status timeout.\n", c->name);
998 return -ETIMEDOUT; 987 return -ETIMEDOUT;
999 } 988 }
1000 989
@@ -1043,8 +1032,8 @@ static int i2o_hrt_get(struct i2o_controller *c)
1043 rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt); 1032 rc = i2o_msg_post_wait_mem(c, m, 20, &c->hrt);
1044 1033
1045 if (rc < 0) { 1034 if (rc < 0) {
1046 printk(KERN_ERR "%s: Unable to get HRT (status=%#x)\n", 1035 osm_err("%s: Unable to get HRT (status=%#x)\n", c->name,
1047 c->name, -rc); 1036 -rc);
1048 return rc; 1037 return rc;
1049 } 1038 }
1050 1039
@@ -1058,8 +1047,8 @@ static int i2o_hrt_get(struct i2o_controller *c)
1058 return i2o_parse_hrt(c); 1047 return i2o_parse_hrt(c);
1059 } 1048 }
1060 1049
1061 printk(KERN_ERR "%s: Unable to get HRT after %d tries, giving up\n", 1050 osm_err("%s: Unable to get HRT after %d tries, giving up\n", c->name,
1062 c->name, I2O_HRT_GET_TRIES); 1051 I2O_HRT_GET_TRIES);
1063 1052
1064 return -EBUSY; 1053 return -EBUSY;
1065} 1054}
@@ -1073,7 +1062,6 @@ void i2o_iop_free(struct i2o_controller *c)
1073 kfree(c); 1062 kfree(c);
1074}; 1063};
1075 1064
1076
1077/** 1065/**
1078 * i2o_iop_release - release the memory for a I2O controller 1066 * i2o_iop_release - release the memory for a I2O controller
1079 * @dev: I2O controller which should be released 1067 * @dev: I2O controller which should be released
@@ -1109,8 +1097,8 @@ struct i2o_controller *i2o_iop_alloc(void)
1109 1097
1110 c = kmalloc(sizeof(*c), GFP_KERNEL); 1098 c = kmalloc(sizeof(*c), GFP_KERNEL);
1111 if (!c) { 1099 if (!c) {
1112 printk(KERN_ERR "i2o: Insufficient memory to allocate a I2O " 1100 osm_err("i2o: Insufficient memory to allocate a I2O controller."
1113 "controller.\n"); 1101 "\n");
1114 return ERR_PTR(-ENOMEM); 1102 return ERR_PTR(-ENOMEM);
1115 } 1103 }
1116 memset(c, 0, sizeof(*c)); 1104 memset(c, 0, sizeof(*c));