Skip to content

Commit

Permalink
e1000e: cleanup: use goto for common work needed by multiple exit points
Browse files Browse the repository at this point in the history
There are two exit points of e1000e_write_nvm_spi() which require the
nvm->ops.release() function pointer called just before exiting.
Consolidate the two duplicate pieces of common work with a goto.  With
this change, the value ret_val will need to be returned instead of 0.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Bruce Allan authored and Jeff Kirsher committed Feb 13, 2012
1 parent fafdbf8 commit ffacd47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/intel/e1000e/nvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,8 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
u8 write_opcode = NVM_WRITE_OPCODE_SPI;

ret_val = e1000_ready_nvm_eeprom(hw);
if (ret_val) {
nvm->ops.release(hw);
return ret_val;
}
if (ret_val)
goto release;

e1000_standby_nvm(hw);

Expand Down Expand Up @@ -422,8 +420,10 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
}

usleep_range(10000, 20000);
release:
nvm->ops.release(hw);
return 0;

return ret_val;
}

/**
Expand Down

0 comments on commit ffacd47

Please sign in to comment.