From: Jaroslav Kysela Date: Mon, 1 Jun 2015 19:02:53 +0000 (+0200) Subject: remove unused function get_device_connection() X-Git-Tag: v4.2.1~2401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dce545142f3f1431ce33b52bbd9b6b2240e1c841;p=thirdparty%2Ftvheadend.git remove unused function get_device_connection() --- diff --git a/src/main.c b/src/main.c index 51cb4b64d..e18fdfe34 100644 --- a/src/main.c +++ b/src/main.c @@ -1197,71 +1197,3 @@ scopedunlock(pthread_mutex_t **mtxp) { pthread_mutex_unlock(*mtxp); } - - -/** - * - */ -const char * -hostconnection2str(int type) -{ - switch(type) { - case HOSTCONNECTION_USB12: - return "USB (12 Mbit/s)"; - - case HOSTCONNECTION_USB480: - return "USB (480 Mbit/s)"; - - case HOSTCONNECTION_PCI: - return "PCI"; - } - return "Unknown"; - -} - - -/** - * - */ -static int -readlinefromfile(const char *path, char *buf, size_t buflen) -{ - int fd = open(path, O_RDONLY); - ssize_t r; - - if(fd == -1) - return -1; - - r = read(fd, buf, buflen - 1); - close(fd); - if(r < 0) - return -1; - - buf[buflen - 1] = 0; - return 0; -} - - -/** - * - */ -int -get_device_connection(const char *dev) -{ - char path[200]; - char l[64]; - int speed; - - snprintf(path, sizeof(path), "/sys/class/%s/device/speed", dev); - - if(readlinefromfile(path, l, sizeof(l))) { - // Unable to read speed, assume it's PCI - return HOSTCONNECTION_PCI; - } else { - speed = atoi(l); - - return speed >= 480 ? HOSTCONNECTION_USB480 : HOSTCONNECTION_USB12; - } -} - - diff --git a/src/tvheadend.h b/src/tvheadend.h index ca7336a6f..f6aeece8e 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -233,18 +233,6 @@ LIST_HEAD(dvr_timerec_entry_list, dvr_timerec_entry); TAILQ_HEAD(th_pktref_queue, th_pktref); LIST_HEAD(streaming_target_list, streaming_target); -/** - * Device connection types - */ -#define HOSTCONNECTION_UNKNOWN 0 -#define HOSTCONNECTION_USB12 1 -#define HOSTCONNECTION_USB480 2 -#define HOSTCONNECTION_PCI 3 - -const char *hostconnection2str(int type); -int get_device_connection(const char *dev); - - /** * Stream component types */