Skip to content

Commit

Permalink
net/txgbe: remove unused functions
Browse files Browse the repository at this point in the history
[ upstream commit 9f1b1fb ]

Remove unused functions for EEPROM read and write.

Fixes: 35c90ec ("net/txgbe: add EEPROM functions")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
  • Loading branch information
Jiawen Wu authored and steevenlee committed May 8, 2021
1 parent 96cc541 commit 991c44b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 76 deletions.
76 changes: 2 additions & 74 deletions drivers/net/txgbe/base/txgbe_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ s32 txgbe_ee_read16(struct txgbe_hw *hw, u32 offset,
}

/**
* txgbe_ee_read_buffer- Read EEPROM word(s) using hostif
* txgbe_ee_readw_buffer- Read EEPROM word(s) using hostif
* @hw: pointer to hardware structure
* @offset: offset of word in the EEPROM to read
* @words: number of words
Expand Down Expand Up @@ -274,42 +274,6 @@ s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data)
return err;
}

/**
* txgbe_ee_read_buffer - Read EEPROM byte(s) using hostif
* @hw: pointer to hardware structure
* @addr: offset of bytes in the EEPROM to read
* @len: number of bytes
* @data: byte(s) read from the EEPROM
*
* Reads a 8 bit byte(s) from the EEPROM using the hostif.
**/
s32 txgbe_ee_read_buffer(struct txgbe_hw *hw,
u32 addr, u32 len, void *data)
{
const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH;
u8 *buf = (u8 *)data;
int err;

err = hw->mac.acquire_swfw_sync(hw, mask);
if (err)
return err;

while (len) {
u32 seg = (len <= TXGBE_PMMBX_DATA_SIZE
? len : TXGBE_PMMBX_DATA_SIZE);

err = txgbe_hic_sr_read(hw, addr, buf, seg);
if (err)
break;

len -= seg;
buf += seg;
}

hw->mac.release_swfw_sync(hw, mask);
return err;
}

/**
* txgbe_ee_write - Write EEPROM word using hostif
* @hw: pointer to hardware structure
Expand Down Expand Up @@ -339,7 +303,7 @@ s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset,
}

/**
* txgbe_ee_write_buffer - Write EEPROM word(s) using hostif
* txgbe_ee_writew_buffer - Write EEPROM word(s) using hostif
* @hw: pointer to hardware structure
* @offset: offset of word in the EEPROM to write
* @words: number of words
Expand Down Expand Up @@ -420,42 +384,6 @@ s32 txgbe_ee_write32(struct txgbe_hw *hw, u32 addr, u32 data)
return err;
}

/**
* txgbe_ee_write_buffer - Write EEPROM byte(s) using hostif
* @hw: pointer to hardware structure
* @addr: offset of bytes in the EEPROM to write
* @len: number of bytes
* @data: word(s) write to the EEPROM
*
* Write a 8 bit byte(s) to the EEPROM using the hostif.
**/
s32 txgbe_ee_write_buffer(struct txgbe_hw *hw,
u32 addr, u32 len, void *data)
{
const u32 mask = TXGBE_MNGSEM_SWMBX | TXGBE_MNGSEM_SWFLASH;
u8 *buf = (u8 *)data;
int err;

err = hw->mac.acquire_swfw_sync(hw, mask);
if (err)
return err;

while (len) {
u32 seg = (len <= TXGBE_PMMBX_DATA_SIZE
? len : TXGBE_PMMBX_DATA_SIZE);

err = txgbe_hic_sr_write(hw, addr, buf, seg);
if (err)
break;

len -= seg;
buf += seg;
}

hw->mac.release_swfw_sync(hw, mask);
return err;
}

/**
* txgbe_calc_eeprom_checksum - Calculates and returns the checksum
* @hw: pointer to hardware structure
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/txgbe/base/txgbe_eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ s32 txgbe_ee_readw_sw(struct txgbe_hw *hw, u32 offset, u16 *data);
s32 txgbe_ee_readw_buffer(struct txgbe_hw *hw, u32 offset, u32 words,
void *data);
s32 txgbe_ee_read32(struct txgbe_hw *hw, u32 addr, u32 *data);
s32 txgbe_ee_read_buffer(struct txgbe_hw *hw, u32 addr, u32 len, void *data);

s32 txgbe_ee_write16(struct txgbe_hw *hw, u32 offset, u16 data);
s32 txgbe_ee_writew_sw(struct txgbe_hw *hw, u32 offset, u16 data);
s32 txgbe_ee_writew_buffer(struct txgbe_hw *hw, u32 offset, u32 words,
void *data);
s32 txgbe_ee_write32(struct txgbe_hw *hw, u32 addr, u32 data);
s32 txgbe_ee_write_buffer(struct txgbe_hw *hw, u32 addr, u32 len, void *data);


#endif /* _TXGBE_EEPROM_H_ */

0 comments on commit 991c44b

Please sign in to comment.