From 2d6e6ca375b85d23f568d6f2fd682d545495fb3b Mon Sep 17 00:00:00 2001 From: yliu79 Date: Wed, 22 May 2019 09:56:45 -0700 Subject: [PATCH] DM: remove unused function usb_native_is_ss_port Change-Id: I7991560b40b936776e45f7b81fee085935eb6eae Tracked-On: #3123 Signed-off-by: Ying Liu Acked-by: Anthony Xu --- devicemodel/hw/usb_core.c | 44 ---------------------------------- devicemodel/include/usb_core.h | 1 - 2 files changed, 45 deletions(-) diff --git a/devicemodel/hw/usb_core.c b/devicemodel/hw/usb_core.c index 61e7ae863..db86ec000 100644 --- a/devicemodel/hw/usb_core.c +++ b/devicemodel/hw/usb_core.c @@ -131,50 +131,6 @@ usb_native_is_bus_existed(uint8_t bus_num) return access(buf, R_OK) ? 0 : 1; } -int -usb_native_is_ss_port(uint8_t bus_of_port) -{ - char buf[128]; - char speed[8]; - int rc, fd; - int usb2_speed_sz = sizeof(NATIVE_USB2_SPEED); - int usb3_speed_sz = sizeof(NATIVE_USB3_SPEED); - - assert(usb_native_is_bus_existed(bus_of_port)); - snprintf(buf, sizeof(buf), "%s/usb%d/speed", NATIVE_USBSYS_DEVDIR, - bus_of_port); - if (access(buf, R_OK)) { - UPRINTF(LWRN, "can't find speed file\r\n"); - return 0; - } - - fd = open(buf, O_RDONLY); - if (fd < 0) { - UPRINTF(LWRN, "fail to open maxchild file\r\n"); - return 0; - } - - rc = read(fd, &speed, sizeof(speed)); - if (rc < 0) { - UPRINTF(LWRN, "fail to read speed file\r\n"); - goto errout; - } - - if (rc < usb2_speed_sz) { - UPRINTF(LWRN, "read invalid speed data\r\n"); - goto errout; - } - - if (strncmp(speed, NATIVE_USB3_SPEED, usb3_speed_sz)) - goto errout; - - close(fd); - return 1; -errout: - close(fd); - return 0; -} - int usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num) { diff --git a/devicemodel/include/usb_core.h b/devicemodel/include/usb_core.h index 5692bfa70..6d663fa92 100644 --- a/devicemodel/include/usb_core.h +++ b/devicemodel/include/usb_core.h @@ -251,7 +251,6 @@ static inline void usb_set_log_level(int level) { usb_log_level = level; } void usb_parse_log_level(char level); struct usb_devemu *usb_emu_finddev(char *name); int usb_native_is_bus_existed(uint8_t bus_num); -int usb_native_is_ss_port(uint8_t bus_of_port); int usb_native_is_port_existed(uint8_t bus_num, uint8_t port_num); struct usb_data_xfer_block *usb_data_xfer_append(struct usb_data_xfer *xfer, void *buf,