]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fx2lafw/api.c
Constify a lot more items.
[libsigrok.git] / src / hardware / fx2lafw / api.c
index e4749f4ebe4cfa72da1f89519efa61c48e8135e5..c3f3ed4b5e89406e3f6d207a9850fb9ce4441a81 100644 (file)
@@ -103,14 +103,14 @@ static const struct fx2lafw_profile supported_fx2[] = {
         * sigrok FX2 based 8-channel logic analyzer
         */
        { 0x1d50, 0x608c, "sigrok", "FX2 LA (8ch)", NULL,
-               FIRMWARE_DIR "/fx2lafw-sigrok-fx2-8ch.fw",
+               "fx2lafw-sigrok-fx2-8ch.fw",
                0, NULL, NULL},
 
        /*
         * sigrok FX2 based 16-channel logic analyzer
         */
        { 0x1d50, 0x608d, "sigrok", "FX2 LA (16ch)", NULL,
-               FIRMWARE_DIR "/fx2lafw-sigrok-fx2-16ch.fw",
+               "fx2lafw-sigrok-fx2-16ch.fw",
                DEV_CAPS_16BIT, NULL, NULL },
 
        { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
@@ -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;