Sync emulator's usb gadget to libdevice-node. 81/225681/2 accepted/tizen/unified/20200224.081536 submit/tizen/20200224.040325
authorINSUN PYO <insun.pyo@samsung.com>
Mon, 24 Feb 2020 02:54:15 +0000 (11:54 +0900)
committerINSUN PYO <insun.pyo@samsung.com>
Mon, 24 Feb 2020 03:06:16 +0000 (12:06 +0900)
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

hw/usb_gadget/usb_gadget.c

index 2dd1760..2bf9d96 100644 (file)
  * 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