diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2014-03-03 14:33:27 +0100 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2014-03-11 09:25:12 +0100 |
commit | 063507ca70086e0b40faf74212fbaf9bfc5384dc (patch) | |
tree | 952dd412d4377dbf673aed2cdfee363656f57ba1 /include/usbg | |
parent | bf0a163d8b747787e21bed358cade4c2e35e51c3 (diff) | |
download | libusbg-063507ca70086e0b40faf74212fbaf9bfc5384dc.tar.gz libusbg-063507ca70086e0b40faf74212fbaf9bfc5384dc.tar.bz2 libusbg-063507ca70086e0b40faf74212fbaf9bfc5384dc.zip |
libusbg: Change usbg_get_function_attrs() to return error code.
usbg_get_function_attrs() may fail due to many reasons
so it should notify the user about exact reason of failure
instead of returning only NULL pointer.
Add also USBG_ERROR_NOT_SUPPORTED to usbg_set_function_attrs().
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'include/usbg')
-rw-r--r-- | include/usbg/usbg.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h index 1bb652e..ae53d22 100644 --- a/include/usbg/usbg.h +++ b/include/usbg/usbg.h @@ -189,6 +189,7 @@ typedef enum { USBG_ERROR_EXIST = -6, USBG_ERROR_NO_DEV = -7, USBG_ERROR_BUSY = -8, + USBG_ERROR_NOT_SUPPORTED = -9, USBG_ERROR_OTHER_ERROR = -99 } usbg_error; @@ -641,9 +642,9 @@ extern usbg_function_type usbg_get_function_type(usbg_function *f); * @brief Get attributes of given function * @param f Pointer to function * @param f_attrs Union to be filled - * @return Pointer to filled structure or NULL if error occurred. + * @return 0 on success usbg_error if error occurred. */ -extern usbg_function_attrs *usbg_get_function_attrs(usbg_function *f, +extern int usbg_get_function_attrs(usbg_function *f, usbg_function_attrs *f_attrs); /** |