Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175125
b: refs/heads/master
c: 53f8aee
h: refs/heads/master
i:
  175123: c11dca2
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent ac91d75 commit 18d51d8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72c71f4827d1f724e8d44677367ed8e924e69de9
refs/heads/master: 53f8aeef7d85046b826fb02e45a97bd6d74e6910
20 changes: 10 additions & 10 deletions trunk/drivers/staging/et131x/et1310_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
* @addr: the address 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)
{
Expand Down Expand Up @@ -227,15 +227,15 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
}

if (err || (index >= MAX_NUM_REGISTER_POLLS))
return FAILURE;
return 0;

/* Step 2: */
control = 0;
control |= LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE;

if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
control)) {
return FAILURE;
return 0;
}

i2c_wack = 1;
Expand Down Expand Up @@ -334,7 +334,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
index++;
}

return writeok ? SUCCESS : FAILURE;
return writeok;
}

/**
Expand All @@ -345,7 +345,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
* @eeprom_id: the ID of the EEPROM
* @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)
{
Expand Down Expand Up @@ -409,22 +409,22 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
}

if (err || (index >= MAX_NUM_REGISTER_POLLS))
return FAILURE;
return 0;

/* Step 2: */
control = 0;
control |= LBCIF_CONTROL_LBCIF_ENABLE;

if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
control)) {
return FAILURE;
return 0;
}

/* Step 3: */

if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
addr)) {
return FAILURE;
return 0;
}

/* Step 4: */
Expand All @@ -446,10 +446,10 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
}

if (err || (index >= MAX_NUM_REGISTER_POLLS))
return FAILURE;
return 0;

/* Step 6: */
*pdata = EXTRACT_DATA_REGISTER(dword1);

return (status & LBCIF_STATUS_ACK_ERROR) ? FAILURE : SUCCESS;
return (status & LBCIF_STATUS_ACK_ERROR) ? 0 : 1;
}
9 changes: 2 additions & 7 deletions trunk/drivers/staging/et131x/et1310_eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,12 @@

#include "et1310_address_map.h"

#ifndef SUCCESS
#define SUCCESS 0
#define FAILURE 1
#endif

/* Forward declaration of the private adapter structure */
struct et131x_adapter;

int32_t EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
int EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
u8 bData);
int32_t EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
int EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
u8 *pbData);

#endif /* _ET1310_EEPROM_H_ */
3 changes: 0 additions & 3 deletions trunk/drivers/staging/et131x/et1310_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@

#include "et1310_address_map.h"

#define TRUEPHY_SUCCESS 0
#define TRUEPHY_FAILURE 1

/* MI Register Addresses */
#define MI_CONTROL_REG 0
#define MI_STATUS_REG 1
Expand Down

0 comments on commit 18d51d8

Please sign in to comment.