diff options
author | Denis Kenzior <denkenz@gmail.com> | 2012-01-18 11:23:18 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-01-18 12:21:30 -0600 |
commit | 74d545d8f4c1a848db151cf4e06a34befdb8688c (patch) | |
tree | 173c284156ea14a40f7a842480d615df2921bb5b /src | |
parent | e04f0ef0276d2df145e34572dfa6463f858b3f0e (diff) |
ofono: Add __ofono_atom_find macro
Diffstat (limited to 'src')
-rw-r--r-- | src/ofono.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ofono.h b/src/ofono.h index 6df67cba..a42e153f 100644 --- a/src/ofono.h +++ b/src/ofono.h @@ -180,6 +180,14 @@ void *__ofono_atom_get_data(struct ofono_atom *atom); const char *__ofono_atom_get_path(struct ofono_atom *atom); struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom); +#define __ofono_atom_find(enum_type, modem) \ +({ \ + struct ofono_atom *atom = \ + __ofono_modem_find_atom(modem, enum_type); \ + \ + atom ? __ofono_atom_get_data(atom) : NULL; \ +}) + void __ofono_atom_register(struct ofono_atom *atom, void (*unregister)(struct ofono_atom *)); void __ofono_atom_unregister(struct ofono_atom *atom); |