From 1f34f2e4262bae8a1aa6d8fd6306b07074d33718 Mon Sep 17 00:00:00 2001 From: Thomas Horsten Date: Sun, 15 Jun 2008 02:17:11 +0100 Subject: [MIPS] Lasat: sysctl fixup LASAT's sysctl interface was broken, it failed a check during boot because a single entry had a sysctl number and the rest were unnumbered. When I fixed it I noticed that the whole sysctl file needed a spring clean, it was using mutexes where it wasn't needed (it's only needed to protect during writes to the EEPROM), so I moved that stuff out and generally cleaned the whole thing up. So now, LASAT's sysctl/proc interface is working again. Signed-off-by: Thomas Horsten Signed-off-by: Ralf Baechle --- arch/mips/lasat/lasat_board.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'arch/mips/lasat/lasat_board.c') diff --git a/arch/mips/lasat/lasat_board.c b/arch/mips/lasat/lasat_board.c index ec2f658c3709..31e328b3814d 100644 --- a/arch/mips/lasat/lasat_board.c +++ b/arch/mips/lasat/lasat_board.c @@ -23,18 +23,19 @@ #include #include #include +#include #include #include #include "at93c.h" /* New model description table */ #include "lasat_models.h" +static DEFINE_MUTEX(lasat_eeprom_mutex); + #define EEPROM_CRC(data, len) (~crc32(~0, data, len)) struct lasat_info lasat_board_info; -void update_bcastaddr(void); - int EEPROMRead(unsigned int pos, unsigned char *data, int len) { int i; @@ -258,10 +259,6 @@ int lasat_init_board_info(void) sprintf(lasat_board_info.li_typestr, "%d", 10 * c); } -#if defined(CONFIG_INET) && defined(CONFIG_SYSCTL) - update_bcastaddr(); -#endif - return 0; } @@ -269,6 +266,8 @@ void lasat_write_eeprom_info(void) { unsigned long crc; + mutex_lock(&lasat_eeprom_mutex); + /* Generate the CRC */ crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info), sizeof(struct lasat_eeprom_struct) - 4); @@ -277,4 +276,6 @@ void lasat_write_eeprom_info(void) /* Write the EEPROM info */ EEPROMWrite(0, (unsigned char *)&lasat_board_info.li_eeprom_info, sizeof(struct lasat_eeprom_struct)); + + mutex_unlock(&lasat_eeprom_mutex); } -- cgit v1.2.3