Add Palm Pre plugin
PATCH 2/3 Add Palm Pre plugin
--- Makefile.am | 3 + plugins/modemconf.c | 3 +- plugins/palmpre.c | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+), 1 deletions(-) create mode 100644 plugins/palmpre.c
Makefile.am +3 -0
@@ -168,6 +168,9 @@ builtin_sources += plugins/novatel.c builtin_modules += hfp builtin_sources += plugins/hfp.c + +builtin_modules += palmpre +builtin_sources += plugins/palmpre.c endif if MAINTAINER_MODE
plugins/modemconf.c +2 -1
@@ -127,7 +127,8 @@ static struct ofono_modem *create_modem(GKeyFile *keyfile, const char *group)if (!g_strcmp0 (driver,"atgen" ) || !g_strcmp0 (driver,"g1" ) || !g_strcmp0 (driver,"calypso" ) || - !g_strcmp0 (driver,"hfp" )) + !g_strcmp0 (driver,"hfp" ) || + !g_strcmp0 (driver,"palmpre" ))set_device (modem, keyfile, group);g_free (driver);
plugins/palmpre.c new file +219 -0
219 lines not on this page · raw message
Signature · 1 line
1.6.1
Hi Andrzej,
plugins/palmpre.c line 75
Quoted 9 lines
plugins/palmpre.c new file +9
-0+static void palmpre_remove (struct ofono_modem *modem) +{ +struct palmpre_data *data =ofono_modem_get_data (modem); + +DBG ("%p" , modem); + +g_free (data); +ofono_modem_set_data (modem,NULL ); +}
Never ever do it this way. The set_data(..., NULL) must come before freeing the data. Otherwise it potentially opens a can of race conditions.
Regards
Marcel
Hi Andrew,
I applied this patch with minor fixes (pointed out by Marcel) and renaming of MSM quirk to QUALCOMM_MSM.
Regards,
-Denis