From 8455cc3f77129dee4e631017bd8dd760609a647b Mon Sep 17 00:00:00 2001 From: Kano Date: Tue, 15 Oct 2013 01:55:31 +1100 Subject: [PATCH] bflsc - allow a 0 in DEVICES IN CHAIN --- driver-bflsc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/driver-bflsc.c b/driver-bflsc.c index bebed38b..4b04bdc1 100644 --- a/driver-bflsc.c +++ b/driver-bflsc.c @@ -645,11 +645,14 @@ static bool getinfo(struct cgpu_info *bflsc, int dev) else if (strstr(firstname, BFLSC_DI_XLINKPRESENT)) sc_dev.xlink_present = strdup(fields[0]); else if (strstr(firstname, BFLSC_DI_DEVICESINCHAIN)) { - sc_info->sc_count = atoi(fields[0]); + if (fields[0][0] == '0') + sc_info->sc_count = 1; + else + sc_info->sc_count = atoi(fields[0]); if (sc_info->sc_count < 1 || sc_info->sc_count > 30) { tmp = str_text(items[i]); applogsiz(LOG_WARNING, BFLSC_APPLOGSIZ, - "%s detect (%s) invalid s-link count: '%s'", + "%s detect (%s) invalid x-link count: '%s'", bflsc->drv->dname, bflsc->device_path, tmp); free(tmp); goto mata;