]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
arachnid-labs-re-load-pro: Add initial driver.
[libsigrok.git] / src / hardware / fx2lafw / api.c
index efb1d0d2e37892fd16d0183865f51531f25b1d6d..4a80b57494d5adb2ba72d7505b56ddd3ac6b822a 100644 (file)
@@ -113,7 +113,7 @@ static const struct fx2lafw_profile supported_fx2[] = {
                "fx2lafw-sigrok-fx2-16ch.fw",
                DEV_CAPS_16BIT, NULL, NULL },
 
-       { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+       ALL_ZERO
 };
 
 static const uint32_t drvopts[] = {
@@ -374,7 +374,7 @@ static int dev_open(struct sr_dev_inst *sdi)
        struct sr_dev_driver *di = sdi->driver;
        struct sr_usb_dev_inst *usb;
        struct dev_context *devc;
-       char *fpga_firmware = NULL;
+       const char *fpga_firmware = NULL;
        int ret;
        int64_t timediff_us, timediff_ms;
 
@@ -567,11 +567,7 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
                break;
        case SR_CONF_CAPTURE_RATIO:
                devc->capture_ratio = g_variant_get_uint64(data);
-               if (devc->capture_ratio > 100) {
-                       devc->capture_ratio = 0;
-                       ret = SR_ERR;
-               } else
-                       ret = SR_OK;
+               ret = (devc->capture_ratio > 100) ? SR_ERR : SR_OK;
                break;
        default:
                ret = SR_ERR_NA;