|
@@ -204,6 +204,13 @@ static bool bitforce_detect_one(const char *devpath)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
applog(LOG_DEBUG, "Found BitForce device on %s", devpath);
|
|
applog(LOG_DEBUG, "Found BitForce device on %s", devpath);
|
|
|
|
|
+
|
|
|
|
|
+ if (likely((!memcmp(pdevbuf, ">>>ID: ", 7)) && (s = strstr(pdevbuf + 3, ">>>"))))
|
|
|
|
|
+ {
|
|
|
|
|
+ s[0] = '\0';
|
|
|
|
|
+ s = strdup(&pdevbuf[7]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
initdata = malloc(sizeof(*initdata));
|
|
initdata = malloc(sizeof(*initdata));
|
|
|
*initdata = (struct bitforce_init_data){
|
|
*initdata = (struct bitforce_init_data){
|
|
|
.sc = false,
|
|
.sc = false,
|
|
@@ -303,10 +310,8 @@ static bool bitforce_detect_one(const char *devpath)
|
|
|
if (initdata->sc)
|
|
if (initdata->sc)
|
|
|
bitforce->cutofftemp = 85;
|
|
bitforce->cutofftemp = 85;
|
|
|
|
|
|
|
|
- if (likely((!memcmp(pdevbuf, ">>>ID: ", 7)) && (s = strstr(pdevbuf + 3, ">>>")))) {
|
|
|
|
|
- s[0] = '\0';
|
|
|
|
|
- bitforce->name = strdup(pdevbuf + 7);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (s)
|
|
|
|
|
+ bitforce->name = s;
|
|
|
bitforce->device_data = initdata;
|
|
bitforce->device_data = initdata;
|
|
|
|
|
|
|
|
mutex_init(&bitforce->device_mutex);
|
|
mutex_init(&bitforce->device_mutex);
|