diff options
-rw-r--r-- | hw/usb_client/usb_client.c | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/hw/usb_client/usb_client.c b/hw/usb_client/usb_client.c index 9a90967..4993f28 100644 --- a/hw/usb_client/usb_client.c +++ b/hw/usb_client/usb_client.c @@ -18,32 +18,7 @@ #include <hw/usb_client.h> -#include <limits.h> -#include <stdio.h> -#include <string.h> - -#define zalloc(amount) calloc(1, amount) - -static int legacy_get_current_gadget(struct usb_client *usb, - struct usb_gadget **_gadget) -{ - return -ENOTSUP; -} - -static bool legacy_is_function_supported(struct usb_client *usb, - struct usb_function *func) -{ - return false; -} - -static bool legacy_is_gadget_supported(struct usb_client *usb, - struct usb_gadget *gadget) -{ - return false; -} - -static int legacy_reconfigure_gadget(struct usb_client *usb, - struct usb_gadget *gadget) +static int legacy_reconfigure_gadget(struct usb_client *usb, struct usb_gadget *gadget) { return 0; } @@ -58,10 +33,6 @@ static int legacy_disable(struct usb_client *usb) return 0; } -static void legacy_free_gadget(struct usb_gadget *gadget) -{ -} - static int legacy_gadget_open(struct hw_info *info, const char *id, struct hw_common **common) { @@ -70,20 +41,18 @@ static int legacy_gadget_open(struct hw_info *info, if (!info || !common) return -EINVAL; - legacy = zalloc(sizeof(*legacy)); + legacy = calloc(1, sizeof(*legacy)); if (!legacy) return -ENOMEM; legacy->common.info = info; - legacy->get_current_gadget = legacy_get_current_gadget; + legacy->reconfigure_gadget = legacy_reconfigure_gadget; - legacy->is_gadget_supported = legacy_is_gadget_supported; - legacy->is_function_supported = legacy_is_function_supported; legacy->enable = legacy_enable; legacy->disable = legacy_disable; - legacy->free_gadget = legacy_free_gadget; *common = &legacy->common; + return 0; } @@ -94,10 +63,10 @@ static int legacy_gadget_close(struct hw_common *common) if (!common) return -EINVAL; - legacy = container_of(common, struct usb_client, - common); + legacy = container_of(common, struct usb_client, common); free(legacy); + return 0; } |