aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_eeprom.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-11-15 18:23:25 -0500
committerRoland Dreier <rolandd@cisco.com>2008-01-25 17:15:26 -0500
commit2c45688faed1b19583c388694025e39001b68c8d (patch)
tree38555f579fbdf6c9d74899482abc754d1793c8d4 /drivers/infiniband/hw/ipath/ipath_eeprom.c
parent727792da2bc22e2ce125faef84aeca3b3e2f4a90 (diff)
IB/ipath: Convert ipath_eep_sem semaphore to a mutex
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Acked-by: Michael Albaugh <Michael.Albaugh@qlogic.com> Tested-by: Arthur Jones <arthur.jones@qlogic.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_eeprom.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_eeprom.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c
index e7c25dbbcdc9..a5b6299ed667 100644
--- a/drivers/infiniband/hw/ipath/ipath_eeprom.c
+++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c
@@ -510,10 +510,10 @@ int ipath_eeprom_read(struct ipath_devdata *dd, u8 eeprom_offset,
510{ 510{
511 int ret; 511 int ret;
512 512
513 ret = down_interruptible(&dd->ipath_eep_sem); 513 ret = mutex_lock_interruptible(&dd->ipath_eep_lock);
514 if (!ret) { 514 if (!ret) {
515 ret = ipath_eeprom_internal_read(dd, eeprom_offset, buff, len); 515 ret = ipath_eeprom_internal_read(dd, eeprom_offset, buff, len);
516 up(&dd->ipath_eep_sem); 516 mutex_unlock(&dd->ipath_eep_lock);
517 } 517 }
518 518
519 return ret; 519 return ret;
@@ -524,10 +524,10 @@ int ipath_eeprom_write(struct ipath_devdata *dd, u8 eeprom_offset,
524{ 524{
525 int ret; 525 int ret;
526 526
527 ret = down_interruptible(&dd->ipath_eep_sem); 527 ret = mutex_lock_interruptible(&dd->ipath_eep_lock);
528 if (!ret) { 528 if (!ret) {
529 ret = ipath_eeprom_internal_write(dd, eeprom_offset, buff, len); 529 ret = ipath_eeprom_internal_write(dd, eeprom_offset, buff, len);
530 up(&dd->ipath_eep_sem); 530 mutex_unlock(&dd->ipath_eep_lock);
531 } 531 }
532 532
533 return ret; 533 return ret;
@@ -616,9 +616,9 @@ void ipath_get_eeprom_info(struct ipath_devdata *dd)
616 goto bail; 616 goto bail;
617 } 617 }
618 618
619 down(&dd->ipath_eep_sem); 619 mutex_lock(&dd->ipath_eep_lock);
620 eep_stat = ipath_eeprom_internal_read(dd, 0, buf, len); 620 eep_stat = ipath_eeprom_internal_read(dd, 0, buf, len);
621 up(&dd->ipath_eep_sem); 621 mutex_unlock(&dd->ipath_eep_lock);
622 622
623 if (eep_stat) { 623 if (eep_stat) {
624 ipath_dev_err(dd, "Failed reading GUID from eeprom\n"); 624 ipath_dev_err(dd, "Failed reading GUID from eeprom\n");
@@ -764,14 +764,14 @@ int ipath_update_eeprom_log(struct ipath_devdata *dd)
764 /* Grab semaphore and read current EEPROM. If we get an 764 /* Grab semaphore and read current EEPROM. If we get an
765 * error, let go, but if not, keep it until we finish write. 765 * error, let go, but if not, keep it until we finish write.
766 */ 766 */
767 ret = down_interruptible(&dd->ipath_eep_sem); 767 ret = mutex_lock_interruptible(&dd->ipath_eep_lock);
768 if (ret) { 768 if (ret) {
769 ipath_dev_err(dd, "Unable to acquire EEPROM for logging\n"); 769 ipath_dev_err(dd, "Unable to acquire EEPROM for logging\n");
770 goto free_bail; 770 goto free_bail;
771 } 771 }
772 ret = ipath_eeprom_internal_read(dd, 0, buf, len); 772 ret = ipath_eeprom_internal_read(dd, 0, buf, len);
773 if (ret) { 773 if (ret) {
774 up(&dd->ipath_eep_sem); 774 mutex_unlock(&dd->ipath_eep_lock);
775 ipath_dev_err(dd, "Unable read EEPROM for logging\n"); 775 ipath_dev_err(dd, "Unable read EEPROM for logging\n");
776 goto free_bail; 776 goto free_bail;
777 } 777 }
@@ -779,7 +779,7 @@ int ipath_update_eeprom_log(struct ipath_devdata *dd)
779 779
780 csum = flash_csum(ifp, 0); 780 csum = flash_csum(ifp, 0);
781 if (csum != ifp->if_csum) { 781 if (csum != ifp->if_csum) {
782 up(&dd->ipath_eep_sem); 782 mutex_unlock(&dd->ipath_eep_lock);
783 ipath_dev_err(dd, "EEPROM cks err (0x%02X, S/B 0x%02X)\n", 783 ipath_dev_err(dd, "EEPROM cks err (0x%02X, S/B 0x%02X)\n",
784 csum, ifp->if_csum); 784 csum, ifp->if_csum);
785 ret = 1; 785 ret = 1;
@@ -849,7 +849,7 @@ int ipath_update_eeprom_log(struct ipath_devdata *dd)
849 csum = flash_csum(ifp, 1); 849 csum = flash_csum(ifp, 1);
850 ret = ipath_eeprom_internal_write(dd, 0, buf, hi_water + 1); 850 ret = ipath_eeprom_internal_write(dd, 0, buf, hi_water + 1);
851 } 851 }
852 up(&dd->ipath_eep_sem); 852 mutex_unlock(&dd->ipath_eep_lock);
853 if (ret) 853 if (ret)
854 ipath_dev_err(dd, "Failed updating EEPROM\n"); 854 ipath_dev_err(dd, "Failed updating EEPROM\n");
855 855