Browse Source

ztex: Convert to lowl_probe

Luke Dashjr 12 years ago
parent
commit
7e5b7e654b
1 changed files with 9 additions and 17 deletions
  1. 9 17
      driver-ztex.c

+ 9 - 17
driver-ztex.c

@@ -77,7 +77,13 @@ static struct cgpu_info *ztex_setup(struct libztex_device *dev, int fpgacount)
 }
 }
 
 
 static
 static
-bool ztex_foundlowl(struct lowlevel_device_info * const info, __maybe_unused void *userp)
+bool ztex_lowl_match(const struct lowlevel_device_info * const info)
+{
+	return lowlevel_match_lowlproduct(info, &lowl_usb, "btcminer for ZTEX");
+}
+
+static
+bool ztex_lowl_probe(const struct lowlevel_device_info * const info)
 {
 {
 	const char * const product = info->product;
 	const char * const product = info->product;
 	const char * const serial = info->serial;
 	const char * const serial = info->serial;
@@ -125,21 +131,6 @@ bool ztex_foundlowl(struct lowlevel_device_info * const info, __maybe_unused voi
 	return true;
 	return true;
 }
 }
 
 
-static bool ztex_detect_one(const char *serial)
-{
-	return lowlevel_detect_serial(ztex_foundlowl, serial);
-}
-
-static int ztex_autodetect()
-{
-	return lowlevel_detect(ztex_foundlowl, "btcminer for ZTEX");
-}
-
-static void ztex_detect()
-{
-	generic_detect(&ztex_drv, ztex_detect_one, ztex_autodetect, 0);
-}
-
 static bool ztex_change_clock_func(struct thr_info *thr, int bestM)
 static bool ztex_change_clock_func(struct thr_info *thr, int bestM)
 {
 {
 	struct cgpu_info *cgpu = thr->cgpu;
 	struct cgpu_info *cgpu = thr->cgpu;
@@ -421,7 +412,8 @@ static void ztex_disable(struct thr_info *thr)
 struct device_drv ztex_drv = {
 struct device_drv ztex_drv = {
 	.dname = "ztex",
 	.dname = "ztex",
 	.name = "ZTX",
 	.name = "ZTX",
-	.drv_detect = ztex_detect,
+	.lowl_match = ztex_lowl_match,
+	.lowl_probe = ztex_lowl_probe,
 	.get_api_extra_device_status = get_ztex_drv_extra_device_status,
 	.get_api_extra_device_status = get_ztex_drv_extra_device_status,
 	.thread_init = ztex_prepare,
 	.thread_init = ztex_prepare,
 	.scanhash = ztex_scanhash,
 	.scanhash = ztex_scanhash,