Merge pull request #1 from kopasiak/master

Merging the following series:

libusbg: clean up and error handling
libusbg: Cleanup, bug fix and refactoring
libusbg: Bug fixes, feature enhancements and API
libusbg: Add error code propagation and attributes refreshing
libusbg: Fix missing read of bcdDevice.

Value of bcdDevice has been never read from Config FS
and this field was leaved uninitialized. Change
usbg_parse_gadget_attrs() to read also from this file.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Fix wrong malloc sizes in allocate functions.

Functions usbg_allocate_function() and usbg_allocate_binding()
had allocated sizeof(usbg_config) instead of usbg_function
and usbg_binding.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add checking for legal function type.

Function type provided by user to functions should
be checked before usage to avoid errors.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Replace usage of function name with type and instance.

User of library should not use directly function name but
only type of the function and name of instance. Using this
will separate user for naming convention on Config FS.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Use config ID and label instead of config name.

Naming convention of Config FS should not be exposed
to user of library. All API functions should use
configuration ID (configuration number) as unique
identificator and configuration label as human
readable description.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>