diff options
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_hpc.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_hpc.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c index c31e7bf34502..83f337c891a9 100644 --- a/drivers/pci/hotplug/ibmphp_hpc.c +++ b/drivers/pci/hotplug/ibmphp_hpc.c | |||
@@ -129,14 +129,14 @@ static int hpc_wait_ctlr_notworking (int, struct controller *, void __iomem *, u | |||
129 | *---------------------------------------------------------------------*/ | 129 | *---------------------------------------------------------------------*/ |
130 | void __init ibmphp_hpc_initvars (void) | 130 | void __init ibmphp_hpc_initvars (void) |
131 | { | 131 | { |
132 | debug ("%s - Entry\n", __FUNCTION__); | 132 | debug ("%s - Entry\n", __func__); |
133 | 133 | ||
134 | mutex_init(&sem_hpcaccess); | 134 | mutex_init(&sem_hpcaccess); |
135 | init_MUTEX (&semOperations); | 135 | init_MUTEX (&semOperations); |
136 | init_MUTEX_LOCKED (&sem_exit); | 136 | init_MUTEX_LOCKED (&sem_exit); |
137 | to_debug = 0; | 137 | to_debug = 0; |
138 | 138 | ||
139 | debug ("%s - Exit\n", __FUNCTION__); | 139 | debug ("%s - Exit\n", __func__); |
140 | } | 140 | } |
141 | 141 | ||
142 | /*---------------------------------------------------------------------- | 142 | /*---------------------------------------------------------------------- |
@@ -154,7 +154,7 @@ static u8 i2c_ctrl_read (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
154 | unsigned long ultemp; | 154 | unsigned long ultemp; |
155 | unsigned long data; // actual data HILO format | 155 | unsigned long data; // actual data HILO format |
156 | 156 | ||
157 | debug_polling ("%s - Entry WPGBbar[%p] index[%x] \n", __FUNCTION__, WPGBbar, index); | 157 | debug_polling ("%s - Entry WPGBbar[%p] index[%x] \n", __func__, WPGBbar, index); |
158 | 158 | ||
159 | //-------------------------------------------------------------------- | 159 | //-------------------------------------------------------------------- |
160 | // READ - step 1 | 160 | // READ - step 1 |
@@ -213,7 +213,7 @@ static u8 i2c_ctrl_read (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
213 | i--; | 213 | i--; |
214 | } | 214 | } |
215 | if (i == 0) { | 215 | if (i == 0) { |
216 | debug ("%s - Error : WPG timeout\n", __FUNCTION__); | 216 | debug ("%s - Error : WPG timeout\n", __func__); |
217 | return HPC_ERROR; | 217 | return HPC_ERROR; |
218 | } | 218 | } |
219 | //-------------------------------------------------------------------- | 219 | //-------------------------------------------------------------------- |
@@ -241,7 +241,7 @@ static u8 i2c_ctrl_read (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
241 | 241 | ||
242 | status = (u8) data; | 242 | status = (u8) data; |
243 | 243 | ||
244 | debug_polling ("%s - Exit index[%x] status[%x]\n", __FUNCTION__, index, status); | 244 | debug_polling ("%s - Exit index[%x] status[%x]\n", __func__, index, status); |
245 | 245 | ||
246 | return (status); | 246 | return (status); |
247 | } | 247 | } |
@@ -262,7 +262,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
262 | unsigned long data; // actual data HILO format | 262 | unsigned long data; // actual data HILO format |
263 | int i; | 263 | int i; |
264 | 264 | ||
265 | debug_polling ("%s - Entry WPGBbar[%p] index[%x] cmd[%x]\n", __FUNCTION__, WPGBbar, index, cmd); | 265 | debug_polling ("%s - Entry WPGBbar[%p] index[%x] cmd[%x]\n", __func__, WPGBbar, index, cmd); |
266 | 266 | ||
267 | rc = 0; | 267 | rc = 0; |
268 | //-------------------------------------------------------------------- | 268 | //-------------------------------------------------------------------- |
@@ -324,7 +324,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
324 | i--; | 324 | i--; |
325 | } | 325 | } |
326 | if (i == 0) { | 326 | if (i == 0) { |
327 | debug ("%s - Exit Error:WPG timeout\n", __FUNCTION__); | 327 | debug ("%s - Exit Error:WPG timeout\n", __func__); |
328 | rc = HPC_ERROR; | 328 | rc = HPC_ERROR; |
329 | } | 329 | } |
330 | 330 | ||
@@ -345,7 +345,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 | |||
345 | rc = HPC_ERROR; | 345 | rc = HPC_ERROR; |
346 | } | 346 | } |
347 | 347 | ||
348 | debug_polling ("%s Exit rc[%x]\n", __FUNCTION__, rc); | 348 | debug_polling ("%s Exit rc[%x]\n", __func__, rc); |
349 | return (rc); | 349 | return (rc); |
350 | } | 350 | } |
351 | 351 | ||
@@ -541,12 +541,12 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
541 | int rc = 0; | 541 | int rc = 0; |
542 | int busindex; | 542 | int busindex; |
543 | 543 | ||
544 | debug_polling ("%s - Entry pslot[%p] cmd[%x] pstatus[%p]\n", __FUNCTION__, pslot, cmd, pstatus); | 544 | debug_polling ("%s - Entry pslot[%p] cmd[%x] pstatus[%p]\n", __func__, pslot, cmd, pstatus); |
545 | 545 | ||
546 | if ((pslot == NULL) | 546 | if ((pslot == NULL) |
547 | || ((pstatus == NULL) && (cmd != READ_ALLSTAT) && (cmd != READ_BUSSTATUS))) { | 547 | || ((pstatus == NULL) && (cmd != READ_ALLSTAT) && (cmd != READ_BUSSTATUS))) { |
548 | rc = -EINVAL; | 548 | rc = -EINVAL; |
549 | err ("%s - Error invalid pointer, rc[%d]\n", __FUNCTION__, rc); | 549 | err ("%s - Error invalid pointer, rc[%d]\n", __func__, rc); |
550 | return rc; | 550 | return rc; |
551 | } | 551 | } |
552 | 552 | ||
@@ -554,7 +554,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
554 | busindex = ibmphp_get_bus_index (pslot->bus); | 554 | busindex = ibmphp_get_bus_index (pslot->bus); |
555 | if (busindex < 0) { | 555 | if (busindex < 0) { |
556 | rc = -EINVAL; | 556 | rc = -EINVAL; |
557 | err ("%s - Exit Error:invalid bus, rc[%d]\n", __FUNCTION__, rc); | 557 | err ("%s - Exit Error:invalid bus, rc[%d]\n", __func__, rc); |
558 | return rc; | 558 | return rc; |
559 | } else | 559 | } else |
560 | index = (u8) busindex; | 560 | index = (u8) busindex; |
@@ -565,7 +565,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
565 | 565 | ||
566 | if (index == HPC_ERROR) { | 566 | if (index == HPC_ERROR) { |
567 | rc = -EINVAL; | 567 | rc = -EINVAL; |
568 | err ("%s - Exit Error:invalid index, rc[%d]\n", __FUNCTION__, rc); | 568 | err ("%s - Exit Error:invalid index, rc[%d]\n", __func__, rc); |
569 | return rc; | 569 | return rc; |
570 | } | 570 | } |
571 | 571 | ||
@@ -641,7 +641,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
641 | ctrl_read (ctlr_ptr, wpg_bbar, | 641 | ctrl_read (ctlr_ptr, wpg_bbar, |
642 | index + WPG_1ST_EXTSLOT_INDEX); | 642 | index + WPG_1ST_EXTSLOT_INDEX); |
643 | } else { | 643 | } else { |
644 | err ("%s - Error ctrl_read failed\n", __FUNCTION__); | 644 | err ("%s - Error ctrl_read failed\n", __func__); |
645 | rc = -EINVAL; | 645 | rc = -EINVAL; |
646 | break; | 646 | break; |
647 | } | 647 | } |
@@ -662,7 +662,7 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus) | |||
662 | 662 | ||
663 | free_hpc_access (); | 663 | free_hpc_access (); |
664 | 664 | ||
665 | debug_polling ("%s - Exit rc[%d]\n", __FUNCTION__, rc); | 665 | debug_polling ("%s - Exit rc[%d]\n", __func__, rc); |
666 | return rc; | 666 | return rc; |
667 | } | 667 | } |
668 | 668 | ||
@@ -681,10 +681,10 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
681 | int rc = 0; | 681 | int rc = 0; |
682 | int timeout; | 682 | int timeout; |
683 | 683 | ||
684 | debug_polling ("%s - Entry pslot[%p] cmd[%x]\n", __FUNCTION__, pslot, cmd); | 684 | debug_polling ("%s - Entry pslot[%p] cmd[%x]\n", __func__, pslot, cmd); |
685 | if (pslot == NULL) { | 685 | if (pslot == NULL) { |
686 | rc = -EINVAL; | 686 | rc = -EINVAL; |
687 | err ("%s - Error Exit rc[%d]\n", __FUNCTION__, rc); | 687 | err ("%s - Error Exit rc[%d]\n", __func__, rc); |
688 | return rc; | 688 | return rc; |
689 | } | 689 | } |
690 | 690 | ||
@@ -694,7 +694,7 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
694 | busindex = ibmphp_get_bus_index (pslot->bus); | 694 | busindex = ibmphp_get_bus_index (pslot->bus); |
695 | if (busindex < 0) { | 695 | if (busindex < 0) { |
696 | rc = -EINVAL; | 696 | rc = -EINVAL; |
697 | err ("%s - Exit Error:invalid bus, rc[%d]\n", __FUNCTION__, rc); | 697 | err ("%s - Exit Error:invalid bus, rc[%d]\n", __func__, rc); |
698 | return rc; | 698 | return rc; |
699 | } else | 699 | } else |
700 | index = (u8) busindex; | 700 | index = (u8) busindex; |
@@ -705,7 +705,7 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
705 | 705 | ||
706 | if (index == HPC_ERROR) { | 706 | if (index == HPC_ERROR) { |
707 | rc = -EINVAL; | 707 | rc = -EINVAL; |
708 | err ("%s - Error Exit rc[%d]\n", __FUNCTION__, rc); | 708 | err ("%s - Error Exit rc[%d]\n", __func__, rc); |
709 | return rc; | 709 | return rc; |
710 | } | 710 | } |
711 | 711 | ||
@@ -719,7 +719,7 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
719 | if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4)) { | 719 | if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4)) { |
720 | wpg_bbar = ioremap (ctlr_ptr->u.wpeg_ctlr.wpegbbar, WPG_I2C_IOREMAP_SIZE); | 720 | wpg_bbar = ioremap (ctlr_ptr->u.wpeg_ctlr.wpegbbar, WPG_I2C_IOREMAP_SIZE); |
721 | 721 | ||
722 | debug ("%s - ctlr id[%x] physical[%lx] logical[%lx] i2c[%x]\n", __FUNCTION__, | 722 | debug ("%s - ctlr id[%x] physical[%lx] logical[%lx] i2c[%x]\n", __func__, |
723 | ctlr_ptr->ctlr_id, (ulong) (ctlr_ptr->u.wpeg_ctlr.wpegbbar), (ulong) wpg_bbar, | 723 | ctlr_ptr->ctlr_id, (ulong) (ctlr_ptr->u.wpeg_ctlr.wpegbbar), (ulong) wpg_bbar, |
724 | ctlr_ptr->u.wpeg_ctlr.i2c_addr); | 724 | ctlr_ptr->u.wpeg_ctlr.i2c_addr); |
725 | } | 725 | } |
@@ -750,7 +750,7 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
750 | msleep(1000); | 750 | msleep(1000); |
751 | if (timeout < 1) { | 751 | if (timeout < 1) { |
752 | done = 1; | 752 | done = 1; |
753 | err ("%s - Error command complete timeout\n", __FUNCTION__); | 753 | err ("%s - Error command complete timeout\n", __func__); |
754 | rc = -EFAULT; | 754 | rc = -EFAULT; |
755 | } else | 755 | } else |
756 | timeout--; | 756 | timeout--; |
@@ -765,7 +765,7 @@ int ibmphp_hpc_writeslot (struct slot * pslot, u8 cmd) | |||
765 | iounmap (wpg_bbar); | 765 | iounmap (wpg_bbar); |
766 | free_hpc_access (); | 766 | free_hpc_access (); |
767 | 767 | ||
768 | debug_polling ("%s - Exit rc[%d]\n", __FUNCTION__, rc); | 768 | debug_polling ("%s - Exit rc[%d]\n", __func__, rc); |
769 | return rc; | 769 | return rc; |
770 | } | 770 | } |
771 | 771 | ||
@@ -803,10 +803,10 @@ void ibmphp_lock_operations (void) | |||
803 | *---------------------------------------------------------------------*/ | 803 | *---------------------------------------------------------------------*/ |
804 | void ibmphp_unlock_operations (void) | 804 | void ibmphp_unlock_operations (void) |
805 | { | 805 | { |
806 | debug ("%s - Entry\n", __FUNCTION__); | 806 | debug ("%s - Entry\n", __func__); |
807 | up (&semOperations); | 807 | up (&semOperations); |
808 | to_debug = 0; | 808 | to_debug = 0; |
809 | debug ("%s - Exit\n", __FUNCTION__); | 809 | debug ("%s - Exit\n", __func__); |
810 | } | 810 | } |
811 | 811 | ||
812 | /*---------------------------------------------------------------------- | 812 | /*---------------------------------------------------------------------- |
@@ -827,7 +827,7 @@ static int poll_hpc(void *data) | |||
827 | int poll_count = 0; | 827 | int poll_count = 0; |
828 | u8 ctrl_count = 0x00; | 828 | u8 ctrl_count = 0x00; |
829 | 829 | ||
830 | debug ("%s - Entry\n", __FUNCTION__); | 830 | debug ("%s - Entry\n", __func__); |
831 | 831 | ||
832 | while (!kthread_should_stop()) { | 832 | while (!kthread_should_stop()) { |
833 | /* try to get the lock to do some kind of hardware access */ | 833 | /* try to get the lock to do some kind of hardware access */ |
@@ -907,7 +907,7 @@ static int poll_hpc(void *data) | |||
907 | msleep(100); | 907 | msleep(100); |
908 | } | 908 | } |
909 | up (&sem_exit); | 909 | up (&sem_exit); |
910 | debug ("%s - Exit\n", __FUNCTION__); | 910 | debug ("%s - Exit\n", __func__); |
911 | return 0; | 911 | return 0; |
912 | } | 912 | } |
913 | 913 | ||
@@ -999,7 +999,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot) | |||
999 | ibmphp_update_slot_info (pslot); | 999 | ibmphp_update_slot_info (pslot); |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | debug ("%s - Exit rc[%d] disable[%x] update[%x]\n", __FUNCTION__, rc, disable, update); | 1002 | debug ("%s - Exit rc[%d] disable[%x] update[%x]\n", __func__, rc, disable, update); |
1003 | 1003 | ||
1004 | return rc; | 1004 | return rc; |
1005 | } | 1005 | } |
@@ -1021,7 +1021,7 @@ static int process_changeinlatch (u8 old, u8 new, struct controller *ctrl) | |||
1021 | u8 mask; | 1021 | u8 mask; |
1022 | int rc = 0; | 1022 | int rc = 0; |
1023 | 1023 | ||
1024 | debug ("%s - Entry old[%x], new[%x]\n", __FUNCTION__, old, new); | 1024 | debug ("%s - Entry old[%x], new[%x]\n", __func__, old, new); |
1025 | // bit 0 reserved, 0 is LSB, check bit 1-6 for 6 slots | 1025 | // bit 0 reserved, 0 is LSB, check bit 1-6 for 6 slots |
1026 | 1026 | ||
1027 | for (i = ctrl->starting_slot_num; i <= ctrl->ending_slot_num; i++) { | 1027 | for (i = ctrl->starting_slot_num; i <= ctrl->ending_slot_num; i++) { |
@@ -1031,15 +1031,15 @@ static int process_changeinlatch (u8 old, u8 new, struct controller *ctrl) | |||
1031 | if (pslot) { | 1031 | if (pslot) { |
1032 | memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot)); | 1032 | memcpy ((void *) &myslot, (void *) pslot, sizeof (struct slot)); |
1033 | rc = ibmphp_hpc_readslot (pslot, READ_ALLSTAT, NULL); | 1033 | rc = ibmphp_hpc_readslot (pslot, READ_ALLSTAT, NULL); |
1034 | debug ("%s - call process_changeinstatus for slot[%d]\n", __FUNCTION__, i); | 1034 | debug ("%s - call process_changeinstatus for slot[%d]\n", __func__, i); |
1035 | process_changeinstatus (pslot, &myslot); | 1035 | process_changeinstatus (pslot, &myslot); |
1036 | } else { | 1036 | } else { |
1037 | rc = -EINVAL; | 1037 | rc = -EINVAL; |
1038 | err ("%s - Error bad pointer for slot[%d]\n", __FUNCTION__, i); | 1038 | err ("%s - Error bad pointer for slot[%d]\n", __func__, i); |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | } | 1041 | } |
1042 | debug ("%s - Exit rc[%d]\n", __FUNCTION__, rc); | 1042 | debug ("%s - Exit rc[%d]\n", __func__, rc); |
1043 | return rc; | 1043 | return rc; |
1044 | } | 1044 | } |
1045 | 1045 | ||
@@ -1050,11 +1050,11 @@ static int process_changeinlatch (u8 old, u8 new, struct controller *ctrl) | |||
1050 | *---------------------------------------------------------------------*/ | 1050 | *---------------------------------------------------------------------*/ |
1051 | int __init ibmphp_hpc_start_poll_thread (void) | 1051 | int __init ibmphp_hpc_start_poll_thread (void) |
1052 | { | 1052 | { |
1053 | debug ("%s - Entry\n", __FUNCTION__); | 1053 | debug ("%s - Entry\n", __func__); |
1054 | 1054 | ||
1055 | ibmphp_poll_thread = kthread_run(poll_hpc, NULL, "hpc_poll"); | 1055 | ibmphp_poll_thread = kthread_run(poll_hpc, NULL, "hpc_poll"); |
1056 | if (IS_ERR(ibmphp_poll_thread)) { | 1056 | if (IS_ERR(ibmphp_poll_thread)) { |
1057 | err ("%s - Error, thread not started\n", __FUNCTION__); | 1057 | err ("%s - Error, thread not started\n", __func__); |
1058 | return PTR_ERR(ibmphp_poll_thread); | 1058 | return PTR_ERR(ibmphp_poll_thread); |
1059 | } | 1059 | } |
1060 | return 0; | 1060 | return 0; |
@@ -1067,7 +1067,7 @@ int __init ibmphp_hpc_start_poll_thread (void) | |||
1067 | *---------------------------------------------------------------------*/ | 1067 | *---------------------------------------------------------------------*/ |
1068 | void __exit ibmphp_hpc_stop_poll_thread (void) | 1068 | void __exit ibmphp_hpc_stop_poll_thread (void) |
1069 | { | 1069 | { |
1070 | debug ("%s - Entry\n", __FUNCTION__); | 1070 | debug ("%s - Entry\n", __func__); |
1071 | 1071 | ||
1072 | kthread_stop(ibmphp_poll_thread); | 1072 | kthread_stop(ibmphp_poll_thread); |
1073 | debug ("before locking operations \n"); | 1073 | debug ("before locking operations \n"); |
@@ -1088,7 +1088,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void) | |||
1088 | up (&sem_exit); | 1088 | up (&sem_exit); |
1089 | debug ("after sem exit up\n"); | 1089 | debug ("after sem exit up\n"); |
1090 | 1090 | ||
1091 | debug ("%s - Exit\n", __FUNCTION__); | 1091 | debug ("%s - Exit\n", __func__); |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | /*---------------------------------------------------------------------- | 1094 | /*---------------------------------------------------------------------- |