Re: [PATCH 5/6] sim: give access to the driver

2018-03-15 Thread Denis Kenzior

Hi Gabriel,


+const struct ofono_sim_driver* ofono_sim_get_driver(struct ofono_sim *sim);
No, please don't do this.  The driver should just issue the relevant 
command directly.


Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


[PATCH 5/6] sim: give access to the driver

2018-03-15 Thread Gabriel Lucas
---
 include/sim.h | 2 ++
 src/sim.c | 5 +
 2 files changed, 7 insertions(+)

diff --git a/include/sim.h b/include/sim.h
index fad4c0d..cf679db 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -217,6 +217,8 @@ struct ofono_sim *ofono_sim_create(struct ofono_modem 
*modem,
 void ofono_sim_register(struct ofono_sim *sim);
 void ofono_sim_remove(struct ofono_sim *sim);
 
+const struct ofono_sim_driver* ofono_sim_get_driver(struct ofono_sim *sim);
+
 void ofono_sim_set_data(struct ofono_sim *sim, void *data);
 void *ofono_sim_get_data(struct ofono_sim *sim);
 
diff --git a/src/sim.c b/src/sim.c
index eb9f56a..f56706f 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -3305,6 +3305,11 @@ void ofono_sim_remove(struct ofono_sim *sim)
__ofono_atom_free(sim->atom);
 }
 
+const struct ofono_sim_driver* ofono_sim_get_driver(struct ofono_sim *sim)
+{
+   return sim->driver;
+}
+
 void ofono_sim_set_data(struct ofono_sim *sim, void *data)
 {
sim->driver_data = data;
-- 
1.9.1

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono


[PATCH 5/6] sim: give access to the driver

2018-03-12 Thread Gabriel Lucas
---
 include/sim.h | 2 ++
 src/sim.c | 5 +
 2 files changed, 7 insertions(+)

diff --git a/include/sim.h b/include/sim.h
index fad4c0d..cf679db 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -217,6 +217,8 @@ struct ofono_sim *ofono_sim_create(struct ofono_modem 
*modem,
 void ofono_sim_register(struct ofono_sim *sim);
 void ofono_sim_remove(struct ofono_sim *sim);
 
+const struct ofono_sim_driver* ofono_sim_get_driver(struct ofono_sim *sim);
+
 void ofono_sim_set_data(struct ofono_sim *sim, void *data);
 void *ofono_sim_get_data(struct ofono_sim *sim);
 
diff --git a/src/sim.c b/src/sim.c
index eb9f56a..f56706f 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -3305,6 +3305,11 @@ void ofono_sim_remove(struct ofono_sim *sim)
__ofono_atom_free(sim->atom);
 }
 
+const struct ofono_sim_driver* ofono_sim_get_driver(struct ofono_sim *sim)
+{
+   return sim->driver;
+}
+
 void ofono_sim_set_data(struct ofono_sim *sim, void *data)
 {
sim->driver_data = data;
-- 
1.9.1

___
ofono mailing list
ofono@ofono.org
https://lists.ofono.org/mailman/listinfo/ofono