From 74d545d8f4c1a848db151cf4e06a34befdb8688c Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 18 Jan 2012 11:23:18 -0600 Subject: ofono: Add __ofono_atom_find macro --- src/ofono.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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); -- cgit v1.2.3