diff options
author | INSUN PYO <insun.pyo@samsung.com> | 2020-02-24 11:54:15 +0900 |
---|---|---|
committer | INSUN PYO <insun.pyo@samsung.com> | 2020-02-24 12:06:16 +0900 |
commit | 746051b23992c0f8d96b380836889e5304a65214 (patch) | |
tree | d20241aa05a521657d2bda8b854a2e5e6af47d80 | |
parent | d26a6c66cb725bbd17d9492bfb6489ecc672709d (diff) | |
download | device-manager-plugin-emul-746051b23992c0f8d96b380836889e5304a65214.tar.gz device-manager-plugin-emul-746051b23992c0f8d96b380836889e5304a65214.tar.bz2 device-manager-plugin-emul-746051b23992c0f8d96b380836889e5304a65214.zip |
Sync emulator's usb gadget to libdevice-node.submit/tizen/20200224.040325accepted/tizen/unified/20200224.081536
The usb gadget hal on all targets has been moved to libdevice-node.
Only emulator hal did not sync, I sync it.
Change-Id: I784379f9666bf82fbebb862d728e6ce80e6891ff
-rw-r--r-- | hw/usb_gadget/usb_gadget.c | 57 |
1 files changed, 2 insertions, 55 deletions
diff --git a/hw/usb_gadget/usb_gadget.c b/hw/usb_gadget/usb_gadget.c index 2dd1760..2bf9d96 100644 --- a/hw/usb_gadget/usb_gadget.c +++ b/hw/usb_gadget/usb_gadget.c @@ -16,67 +16,14 @@ * limitations under the License. */ -#ifndef __HW_USB_GADGET_SIMPLE_TRANSLATOR_H__ - #include <hw/usb_gadget.h> -#include <stdlib.h> -#include <errno.h> - -#define zalloc(amount) calloc(1, amount) - -static void emul_cleanup_gadget(struct usb_gadget *gadget) -{ -} - -static int emul_id_to_gadget(struct usb_gadget_id *gadget_id, - struct usb_gadget **_gadget) -{ - return -ENOTSUP; -} - -static int emul_translator_open(struct hw_info *info, - const char *id, struct hw_common **common) -{ - struct usb_gadget_translator *simple_translator; - - if (!info || !common) - return -EINVAL; - - simple_translator = zalloc(sizeof(*simple_translator)); - if (!simple_translator) - return -ENOMEM; - - simple_translator->common.info = info; - simple_translator->id_to_gadget = emul_id_to_gadget; - simple_translator->cleanup_gadget = emul_cleanup_gadget; - - *common = &simple_translator->common; - return 0; -} - -static int emul_translator_close(struct hw_common *common) -{ - struct usb_gadget_translator *simple_translator; - - if (!common) - return -EINVAL; - - simple_translator = container_of(common, struct usb_gadget_translator, - common); - - free(simple_translator); - return 0; -} - HARDWARE_MODULE_STRUCTURE = { .magic = HARDWARE_INFO_TAG, .hal_version = HARDWARE_INFO_VERSION, .device_version = USB_GADGET_DEVICE_VERSION, .id = USB_GADGET_DEVICE_ID, .name = "simple_translator", - .open = emul_translator_open, - .close = emul_translator_close, + .open = simple_translator_open, + .close = simple_translator_close, }; - -#endif |