aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-01 10:51:26 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-04 17:38:15 +0200
commit89582f7e77068bc38fa9ee391f5c898913f241a7 (patch)
tree5ff4505d67bc65ec603532805fa6ab7e4db1685a
parent270cf418fc64ad77b179f75394c5dc34c95f4388 (diff)
sysmobts: Add a method to free cached epprom resources
Close the cached file descriptor once the calibration data is loaded and applied.
-rw-r--r--src/osmo-bts-sysmo/calib_file.c1
-rw-r--r--src/osmo-bts-sysmo/eeprom.c7
-rw-r--r--src/osmo-bts-sysmo/eeprom.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/osmo-bts-sysmo/calib_file.c b/src/osmo-bts-sysmo/calib_file.c
index a81deae0..84de31fb 100644
--- a/src/osmo-bts-sysmo/calib_file.c
+++ b/src/osmo-bts-sysmo/calib_file.c
@@ -379,6 +379,7 @@ static int calib_send_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg)
&calib_files[st->last_file_idx]);
LOGP(DL1C, LOGL_INFO, "L1 calibration table loading complete!\n");
+ eeprom_free_resources();
return 0;
}
diff --git a/src/osmo-bts-sysmo/eeprom.c b/src/osmo-bts-sysmo/eeprom.c
index 272d41a0..e3b94fc3 100644
--- a/src/osmo-bts-sysmo/eeprom.c
+++ b/src/osmo-bts-sysmo/eeprom.c
@@ -1323,6 +1323,13 @@ int eeprom_dump( int addr, int size, int hex )
static FILE *g_file;
+void eeprom_free_resources(void)
+{
+ if (g_file)
+ fclose(g_file);
+ g_file = NULL;
+}
+
/**
* Read up to 'size' bytes of data from the EEPROM starting at offset 'addr'.
*/
diff --git a/src/osmo-bts-sysmo/eeprom.h b/src/osmo-bts-sysmo/eeprom.h
index 28628bc7..03b8bfd9 100644
--- a/src/osmo-bts-sysmo/eeprom.h
+++ b/src/osmo-bts-sysmo/eeprom.h
@@ -291,5 +291,6 @@ eeprom_Error_t eeprom_ReadRxCal( int iBand, int iUplink, eeprom_RxCal_t *pRxCal
****************************************************************************/
eeprom_Error_t eeprom_WriteRxCal( int iBand, int iUplink, const eeprom_RxCal_t *pRxCal );
+void eeprom_free_resources(void);
#endif // EEPROM_H__