Staging: et131x: kill SUCCESS and FAILURE defines
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
72c71f4827
commit
53f8aeef7d
3 changed files with 12 additions and 20 deletions
|
@ -146,7 +146,7 @@
|
||||||
* @addr: the address to write
|
* @addr: the address to write
|
||||||
* @data: the value to write
|
* @data: the value to write
|
||||||
*
|
*
|
||||||
* Returns SUCCESS or FAILURE
|
* Returns 1 for a successful write.
|
||||||
*/
|
*/
|
||||||
int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
||||||
{
|
{
|
||||||
|
@ -227,7 +227,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
||||||
return FAILURE;
|
return 0;
|
||||||
|
|
||||||
/* Step 2: */
|
/* Step 2: */
|
||||||
control = 0;
|
control = 0;
|
||||||
|
@ -235,7 +235,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
||||||
|
|
||||||
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
|
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
|
||||||
control)) {
|
control)) {
|
||||||
return FAILURE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_wack = 1;
|
i2c_wack = 1;
|
||||||
|
@ -334,7 +334,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return writeok ? SUCCESS : FAILURE;
|
return writeok;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -345,7 +345,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
|
||||||
* @eeprom_id: the ID of the EEPROM
|
* @eeprom_id: the ID of the EEPROM
|
||||||
* @addrmode: how the EEPROM is to be accessed
|
* @addrmode: how the EEPROM is to be accessed
|
||||||
*
|
*
|
||||||
* Returns SUCCESS or FAILURE
|
* Returns 1 for a successful read
|
||||||
*/
|
*/
|
||||||
int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
|
int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +409,7 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
||||||
return FAILURE;
|
return 0;
|
||||||
|
|
||||||
/* Step 2: */
|
/* Step 2: */
|
||||||
control = 0;
|
control = 0;
|
||||||
|
@ -417,14 +417,14 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
|
||||||
|
|
||||||
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
|
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
|
||||||
control)) {
|
control)) {
|
||||||
return FAILURE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 3: */
|
/* Step 3: */
|
||||||
|
|
||||||
if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
|
if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
|
||||||
addr)) {
|
addr)) {
|
||||||
return FAILURE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 4: */
|
/* Step 4: */
|
||||||
|
@ -446,10 +446,10 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
if (err || (index >= MAX_NUM_REGISTER_POLLS))
|
||||||
return FAILURE;
|
return 0;
|
||||||
|
|
||||||
/* Step 6: */
|
/* Step 6: */
|
||||||
*pdata = EXTRACT_DATA_REGISTER(dword1);
|
*pdata = EXTRACT_DATA_REGISTER(dword1);
|
||||||
|
|
||||||
return (status & LBCIF_STATUS_ACK_ERROR) ? FAILURE : SUCCESS;
|
return (status & LBCIF_STATUS_ACK_ERROR) ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,17 +61,12 @@
|
||||||
|
|
||||||
#include "et1310_address_map.h"
|
#include "et1310_address_map.h"
|
||||||
|
|
||||||
#ifndef SUCCESS
|
|
||||||
#define SUCCESS 0
|
|
||||||
#define FAILURE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Forward declaration of the private adapter structure */
|
/* Forward declaration of the private adapter structure */
|
||||||
struct et131x_adapter;
|
struct et131x_adapter;
|
||||||
|
|
||||||
int32_t EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
|
int EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
|
||||||
u8 bData);
|
u8 bData);
|
||||||
int32_t EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
|
int EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
|
||||||
u8 *pbData);
|
u8 *pbData);
|
||||||
|
|
||||||
#endif /* _ET1310_EEPROM_H_ */
|
#endif /* _ET1310_EEPROM_H_ */
|
||||||
|
|
|
@ -61,9 +61,6 @@
|
||||||
|
|
||||||
#include "et1310_address_map.h"
|
#include "et1310_address_map.h"
|
||||||
|
|
||||||
#define TRUEPHY_SUCCESS 0
|
|
||||||
#define TRUEPHY_FAILURE 1
|
|
||||||
|
|
||||||
/* MI Register Addresses */
|
/* MI Register Addresses */
|
||||||
#define MI_CONTROL_REG 0
|
#define MI_CONTROL_REG 0
|
||||||
#define MI_STATUS_REG 1
|
#define MI_STATUS_REG 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue