All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <james.prestwood@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/3] simauth: remove driver code from core simauth atom
Date: Thu, 09 Nov 2017 09:52:16 -0800	[thread overview]
Message-ID: <1510249937-22427-2-git-send-email-james.prestwood@linux.intel.com> (raw)
In-Reply-To: <1510249937-22427-1-git-send-email-james.prestwood@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2552 bytes --]

---
 src/sim-auth.c | 49 +++++--------------------------------------------
 1 file changed, 5 insertions(+), 44 deletions(-)

diff --git a/src/sim-auth.c b/src/sim-auth.c
index f5ae7b6..b2c205d 100644
--- a/src/sim-auth.c
+++ b/src/sim-auth.c
@@ -39,8 +39,6 @@
 
 #define SIM_AUTH_MAX_RANDS	3
 
-static GSList *g_drivers = NULL;
-
 /*
  * Temporary handle used for the command authentication sequence.
  */
@@ -136,25 +134,6 @@ static void free_apps(struct ofono_sim_auth *sa)
 	g_slist_free(sa->aid_objects);
 }
 
-int ofono_sim_auth_driver_register(const struct ofono_sim_auth_driver *d)
-{
-	DBG("driver: %p, name: %s", d, d->name);
-
-	if (d->probe == NULL)
-		return -EINVAL;
-
-	g_drivers = g_slist_prepend(g_drivers, (void *) d);
-
-	return 0;
-}
-
-void ofono_sim_auth_driver_unregister(const struct ofono_sim_auth_driver *d)
-{
-	DBG("driver: %p, name: %s", d, d->name);
-
-	g_drivers = g_slist_remove(g_drivers, (void *) d);
-}
-
 static void sim_auth_unregister(struct ofono_atom *atom)
 {
 	struct ofono_sim_auth *sa = __ofono_atom_get_data(atom);
@@ -173,21 +152,14 @@ static void sim_auth_remove(struct ofono_atom *atom)
 	if (sa == NULL)
 		return;
 
-	if (sa->driver && sa->driver->remove)
-		sa->driver->remove(sa);
-
 	g_free(sa);
 }
 
-struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem,
-						unsigned int vendor,
-						const char *driver, void *data)
+static void sim_auth_register(struct ofono_sim_auth *sa);
+
+struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem)
 {
 	struct ofono_sim_auth *sa;
-	GSList *l;
-
-	if (driver == NULL)
-		return NULL;
 
 	sa = g_new0(struct ofono_sim_auth, 1);
 
@@ -197,18 +169,7 @@ struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem,
 	sa->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_SIM_AUTH,
 						sim_auth_remove, sa);
 
-	for (l = g_drivers; l; l = l->next) {
-		const struct ofono_sim_auth_driver *drv = l->data;
-
-		if (g_strcmp0(drv->name, driver))
-			continue;
-
-		if (drv->probe(sa, vendor, data) < 0)
-			continue;
-
-		sa->driver = drv;
-		break;
-	}
+	sim_auth_register(sa);
 
 	return sa;
 }
@@ -725,7 +686,7 @@ static char *build_nai(const char *imsi)
 	return nai;
 }
 
-void ofono_sim_auth_register(struct ofono_sim_auth *sa)
+static void sim_auth_register(struct ofono_sim_auth *sa)
 {
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(sa->atom);
-- 
2.7.4


  reply	other threads:[~2017-11-09 17:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 17:52 [PATCH 1/3] simauth: remove driver API definitions from simauth include James Prestwood
2017-11-09 17:52 ` James Prestwood [this message]
2017-11-09 17:52 ` [PATCH 3/3] plugins: updated plugins using simauth module James Prestwood
2017-11-09 17:56 ` [PATCH 1/3] simauth: remove driver API definitions from simauth include Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1510249937-22427-2-git-send-email-james.prestwood@linux.intel.com \
    --to=james.prestwood@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.