From: INSUN PYO Date: Mon, 24 Feb 2020 02:54:15 +0000 (+0900) Subject: Sync emulator's usb gadget to libdevice-node. X-Git-Tag: accepted/tizen/unified/20200224.081536^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=746051b23992c0f8d96b380836889e5304a65214;p=platform%2Fadaptation%2Femulator%2Fdevice-manager-plugin-emul.git Sync emulator's usb gadget to libdevice-node. 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 --- 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 -#include -#include - -#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