diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-09-11 12:36:35 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-09-11 12:39:56 -0500 |
commit | cbb36acee848bdbfb3480bde3ae6d9ac79137e69 (patch) | |
tree | dde7f149bba50581f0a8ff85fc6fd9529320ce5e /drivers/atmodem/atutil.h | |
parent | 32fc30fa02a6d46b78f45e446b2347754ba2136a (diff) | |
download | ofono-cbb36acee848bdbfb3480bde3ae6d9ac79137e69.tar.bz2 |
Rework DECLARE_FAILURE to be a bit nicer
Diffstat (limited to 'drivers/atmodem/atutil.h')
-rw-r--r-- | drivers/atmodem/atutil.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/atmodem/atutil.h b/drivers/atmodem/atutil.h index 06d7fc31..c30c70b7 100644 --- a/drivers/atmodem/atutil.h +++ b/drivers/atmodem/atutil.h @@ -48,3 +48,12 @@ static inline struct cb_data *cb_data_new(void *cb, void *data) e.type = OFONO_ERROR_TYPE_FAILURE; \ e.error = 0 \ +#define CALLBACK_WITH_FAILURE(cb, args...) \ + do { \ + struct ofono_error cb_e; \ + cb_e.type = OFONO_ERROR_TYPE_FAILURE; \ + cb_e.error = 0; \ + \ + cb(&cb_e, ##args); \ + } while (0) \ + |