diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-test.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-test.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-test.c b/drivers/net/wireless/iwlwifi/iwl-test.c index 1a226114fe73..ce0c67b425ee 100644 --- a/drivers/net/wireless/iwlwifi/iwl-test.c +++ b/drivers/net/wireless/iwlwifi/iwl-test.c @@ -5,7 +5,7 @@ * * GPL LICENSE SUMMARY * - * Copyright(c) 2010 - 2012 Intel Corporation. All rights reserved. + * Copyright(c) 2010 - 2013 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -30,7 +30,7 @@ * * BSD LICENSE * - * Copyright(c) 2010 - 2012 Intel Corporation. All rights reserved. + * Copyright(c) 2010 - 2013 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -466,9 +466,7 @@ static int iwl_test_indirect_read(struct iwl_test *tst, u32 addr, u32 size) /* Hard-coded periphery absolute address */ if (IWL_ABS_PRPH_START <= addr && addr < IWL_ABS_PRPH_START + PRPH_END) { - spin_lock_irqsave(&trans->reg_lock, flags); - if (!iwl_trans_grab_nic_access(trans, false)) { - spin_unlock_irqrestore(&trans->reg_lock, flags); + if (!iwl_trans_grab_nic_access(trans, false, &flags)) { return -EIO; } iwl_write32(trans, HBUS_TARG_PRPH_RADDR, @@ -476,8 +474,7 @@ static int iwl_test_indirect_read(struct iwl_test *tst, u32 addr, u32 size) for (i = 0; i < size; i += 4) *(u32 *)(tst->mem.addr + i) = iwl_read32(trans, HBUS_TARG_PRPH_RDAT); - iwl_trans_release_nic_access(trans); - spin_unlock_irqrestore(&trans->reg_lock, flags); + iwl_trans_release_nic_access(trans, &flags); } else { /* target memory (SRAM) */ iwl_trans_read_mem(trans, addr, tst->mem.addr, tst->mem.size / 4); @@ -506,19 +503,13 @@ static int iwl_test_indirect_write(struct iwl_test *tst, u32 addr, /* Periphery writes can be 1-3 bytes long, or DWORDs */ if (size < 4) { memcpy(&val, buf, size); - spin_lock_irqsave(&trans->reg_lock, flags); - if (!iwl_trans_grab_nic_access(trans, false)) { - spin_unlock_irqrestore(&trans->reg_lock, flags); + if (!iwl_trans_grab_nic_access(trans, false, &flags)) return -EIO; - } iwl_write32(trans, HBUS_TARG_PRPH_WADDR, (addr & 0x0000FFFF) | ((size - 1) << 24)); iwl_write32(trans, HBUS_TARG_PRPH_WDAT, val); - iwl_trans_release_nic_access(trans); - /* needed after consecutive writes w/o read */ - mmiowb(); - spin_unlock_irqrestore(&trans->reg_lock, flags); + iwl_trans_release_nic_access(trans, &flags); } else { if (size % 4) return -EINVAL; |