Skip to content

Commit

Permalink
eeprom: Make eeprom_write_enable() weak
Browse files Browse the repository at this point in the history
Make this function weak and implement it's weak implementation
so that the boards can just reimplement it. This zaps the horrid
CONFIG_SYS_EEPROM_WREN macro.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Heiko Schocher <[email protected]>
Reviewed-by: Heiko Schocher <[email protected]>
  • Loading branch information
Marek Vasut authored and trini committed Nov 22, 2015
1 parent 02c321c commit 52cd47c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions common/cmd_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@
#endif
#endif

#if defined(CONFIG_SYS_EEPROM_WREN)
extern int eeprom_write_enable (unsigned dev_addr, int state);
#endif
__weak int eeprom_write_enable(unsigned dev_addr, int state)
{
return 0;
}

void eeprom_init(void)
{
Expand Down Expand Up @@ -163,9 +164,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
int rcode = 0;
uchar addr[3];

#if defined(CONFIG_SYS_EEPROM_WREN)
eeprom_write_enable (dev_addr,1);
#endif
eeprom_write_enable(dev_addr, 1);

/*
* Write data until done or would cross a write page boundary.
* We must write the address again when changing pages
Expand Down Expand Up @@ -215,9 +215,9 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn
udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000);
#endif
}
#if defined(CONFIG_SYS_EEPROM_WREN)
eeprom_write_enable (dev_addr,0);
#endif

eeprom_write_enable(dev_addr, 0);

return rcode;
}

Expand Down

0 comments on commit 52cd47c

Please sign in to comment.