aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-05-08 15:47:31 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2016-05-09 15:10:26 +0200
commitc45c32ce47f429099cb0f1cabc1b45b9bcf44855 (patch)
treef7232d5322317a8b39e74c6d756d032d19b9af4d
parent1f8f5bc08e0f684156baac513431b40d79ab4ea1 (diff)
std_init(): Drop check if pass in driver is non-NULL
std_init() checks if the pass in struct sr_dev_driver is non-NULL and prints a error message and returns an error if it is NULL. std_init() is exclusively called from driver init() callbacks for which the core already checks if the struct sr_dev_driver is non-NULL before invoking the callback. This means the check in std_init() will always evaluate to false. So drop this check. This also means that the prefix parameter that was used in the error message is no longer needed and can be removed from the function signature. Doing so will make the std_init() function signature identical to the init() callback signature which will allow to directly use it as such. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
-rw-r--r--src/hardware/agilent-dmm/api.c2
-rw-r--r--src/hardware/appa-55ii/api.c2
-rw-r--r--src/hardware/arachnid-labs-re-load-pro/api.c2
-rw-r--r--src/hardware/asix-sigma/api.c2
-rw-r--r--src/hardware/atten-pps3xxx/api.c2
-rw-r--r--src/hardware/baylibre-acme/api.c2
-rw-r--r--src/hardware/beaglelogic/api.c2
-rw-r--r--src/hardware/brymen-bm86x/api.c2
-rw-r--r--src/hardware/brymen-dmm/api.c2
-rw-r--r--src/hardware/cem-dt-885x/api.c2
-rw-r--r--src/hardware/center-3xx/api.c2
-rw-r--r--src/hardware/chronovu-la/api.c2
-rw-r--r--src/hardware/colead-slm/api.c2
-rw-r--r--src/hardware/conrad-digi-35-cpu/api.c2
-rw-r--r--src/hardware/demo/demo.c2
-rw-r--r--src/hardware/deree-de5000/api.c2
-rw-r--r--src/hardware/fluke-dmm/api.c2
-rw-r--r--src/hardware/ftdi-la/api.c2
-rw-r--r--src/hardware/fx2lafw/api.c2
-rw-r--r--src/hardware/gmc-mh-1x-2x/api.c2
-rw-r--r--src/hardware/gwinstek-gds-800/api.c2
-rw-r--r--src/hardware/hameg-hmo/api.c2
-rw-r--r--src/hardware/hantek-6xxx/api.c2
-rw-r--r--src/hardware/hantek-dso/api.c2
-rw-r--r--src/hardware/hp-3457a/api.c2
-rw-r--r--src/hardware/hung-chang-dso-2100/api.c2
-rw-r--r--src/hardware/ikalogic-scanalogic2/api.c2
-rw-r--r--src/hardware/ikalogic-scanaplus/api.c2
-rw-r--r--src/hardware/kecheng-kc-330b/api.c2
-rw-r--r--src/hardware/kern-scale/api.c2
-rw-r--r--src/hardware/korad-kaxxxxp/api.c2
-rw-r--r--src/hardware/lascar-el-usb/api.c2
-rw-r--r--src/hardware/lecroy-logicstudio/api.c2
-rw-r--r--src/hardware/link-mso19/api.c2
-rw-r--r--src/hardware/manson-hcs-3xxx/api.c2
-rw-r--r--src/hardware/maynuo-m97/api.c2
-rw-r--r--src/hardware/mic-985xx/api.c2
-rw-r--r--src/hardware/motech-lps-30x/api.c2
-rw-r--r--src/hardware/norma-dmm/api.c2
-rw-r--r--src/hardware/openbench-logic-sniffer/api.c2
-rw-r--r--src/hardware/pipistrello-ols/api.c2
-rw-r--r--src/hardware/rigol-ds/api.c2
-rw-r--r--src/hardware/saleae-logic16/api.c2
-rw-r--r--src/hardware/scpi-pps/api.c2
-rw-r--r--src/hardware/serial-dmm/api.c2
-rw-r--r--src/hardware/sysclk-lwla/api.c2
-rw-r--r--src/hardware/teleinfo/api.c2
-rw-r--r--src/hardware/testo/api.c2
-rw-r--r--src/hardware/tondaj-sl-814/api.c2
-rw-r--r--src/hardware/uni-t-dmm/api.c2
-rw-r--r--src/hardware/uni-t-ut32x/api.c2
-rw-r--r--src/hardware/victor-dmm/api.c2
-rw-r--r--src/hardware/yokogawa-dlm/api.c2
-rw-r--r--src/hardware/zeroplus-logic-cube/api.c2
-rw-r--r--src/libsigrok-internal.h3
-rw-r--r--src/session_driver.c2
-rw-r--r--src/std.c9
57 files changed, 57 insertions, 65 deletions
diff --git a/src/hardware/agilent-dmm/api.c b/src/hardware/agilent-dmm/api.c
index da6b84c..b7e4a6b 100644
--- a/src/hardware/agilent-dmm/api.c
+++ b/src/hardware/agilent-dmm/api.c
@@ -74,7 +74,7 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/appa-55ii/api.c b/src/hardware/appa-55ii/api.c
index 6163f2d..14b8ea9 100644
--- a/src/hardware/appa-55ii/api.c
+++ b/src/hardware/appa-55ii/api.c
@@ -46,7 +46,7 @@ SR_PRIV struct sr_dev_driver appa_55ii_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/arachnid-labs-re-load-pro/api.c b/src/hardware/arachnid-labs-re-load-pro/api.c
index 4543a02..4bbbf24 100644
--- a/src/hardware/arachnid-labs-re-load-pro/api.c
+++ b/src/hardware/arachnid-labs-re-load-pro/api.c
@@ -60,7 +60,7 @@ SR_PRIV struct sr_dev_driver arachnid_labs_re_load_pro_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/asix-sigma/api.c b/src/hardware/asix-sigma/api.c
index cb5eeca..cb61b92 100644
--- a/src/hardware/asix-sigma/api.c
+++ b/src/hardware/asix-sigma/api.c
@@ -65,7 +65,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/atten-pps3xxx/api.c b/src/hardware/atten-pps3xxx/api.c
index e46bff4..fea793a 100644
--- a/src/hardware/atten-pps3xxx/api.c
+++ b/src/hardware/atten-pps3xxx/api.c
@@ -79,7 +79,7 @@ SR_PRIV struct sr_dev_driver atten_pps3203_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options, int modelid)
diff --git a/src/hardware/baylibre-acme/api.c b/src/hardware/baylibre-acme/api.c
index 49cf96a..9103aeb 100644
--- a/src/hardware/baylibre-acme/api.c
+++ b/src/hardware/baylibre-acme/api.c
@@ -55,7 +55,7 @@ static const uint64_t samplerates[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/beaglelogic/api.c b/src/hardware/beaglelogic/api.c
index e8309bd..e28350c 100644
--- a/src/hardware/beaglelogic/api.c
+++ b/src/hardware/beaglelogic/api.c
@@ -62,7 +62,7 @@ static const uint64_t samplerates[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct dev_context *beaglelogic_devc_alloc(void)
diff --git a/src/hardware/brymen-bm86x/api.c b/src/hardware/brymen-bm86x/api.c
index cf41e90..88a9a5a 100644
--- a/src/hardware/brymen-bm86x/api.c
+++ b/src/hardware/brymen-bm86x/api.c
@@ -37,7 +37,7 @@ SR_PRIV struct sr_dev_driver brymen_bm86x_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/brymen-dmm/api.c b/src/hardware/brymen-dmm/api.c
index 28e2a5b..9aad650 100644
--- a/src/hardware/brymen-dmm/api.c
+++ b/src/hardware/brymen-dmm/api.c
@@ -37,7 +37,7 @@ static struct sr_dev_driver *di = &brymen_bm857_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *brymen_scan(const char *conn, const char *serialcomm)
diff --git a/src/hardware/cem-dt-885x/api.c b/src/hardware/cem-dt-885x/api.c
index 40b8c6d..c7816ba 100644
--- a/src/hardware/cem-dt-885x/api.c
+++ b/src/hardware/cem-dt-885x/api.c
@@ -73,7 +73,7 @@ SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/center-3xx/api.c b/src/hardware/center-3xx/api.c
index 6c0e089..c78825a 100644
--- a/src/hardware/center-3xx/api.c
+++ b/src/hardware/center-3xx/api.c
@@ -58,7 +58,7 @@ SR_PRIV const struct center_dev_info center_devs[] = {
static int init(struct sr_context *sr_ctx, int idx)
{
- return std_init(center_devs[idx].di, sr_ctx, LOG_PREFIX);
+ return std_init(center_devs[idx].di, sr_ctx);
}
static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c
index fa28d82..322ac3b 100644
--- a/src/hardware/chronovu-la/api.c
+++ b/src/hardware/chronovu-la/api.c
@@ -66,7 +66,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static int add_device(int model, struct libusb_device_descriptor *des,
diff --git a/src/hardware/colead-slm/api.c b/src/hardware/colead-slm/api.c
index 7cbd2e6..56b3ead 100644
--- a/src/hardware/colead-slm/api.c
+++ b/src/hardware/colead-slm/api.c
@@ -46,7 +46,7 @@ SR_PRIV struct sr_dev_driver colead_slm_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c
index 357dad9..16c4157 100644
--- a/src/hardware/conrad-digi-35-cpu/api.c
+++ b/src/hardware/conrad-digi-35-cpu/api.c
@@ -43,7 +43,7 @@ SR_PRIV struct sr_dev_driver conrad_digi_35_cpu_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c
index 1587d5e..3df4ecc 100644
--- a/src/hardware/demo/demo.c
+++ b/src/hardware/demo/demo.c
@@ -181,7 +181,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static void generate_analog_pattern(struct analog_gen *ag, uint64_t sample_rate)
diff --git a/src/hardware/deree-de5000/api.c b/src/hardware/deree-de5000/api.c
index 7a83202..3f2a54a 100644
--- a/src/hardware/deree-de5000/api.c
+++ b/src/hardware/deree-de5000/api.c
@@ -41,7 +41,7 @@ SR_PRIV struct sr_dev_driver deree_de5000_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static int dev_clear(const struct sr_dev_driver *di)
diff --git a/src/hardware/fluke-dmm/api.c b/src/hardware/fluke-dmm/api.c
index 8d4ed2b..cd34c18 100644
--- a/src/hardware/fluke-dmm/api.c
+++ b/src/hardware/fluke-dmm/api.c
@@ -61,7 +61,7 @@ static const struct flukedmm_profile supported_flukedmm[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *fluke_scan(struct sr_dev_driver *di, const char *conn,
diff --git a/src/hardware/ftdi-la/api.c b/src/hardware/ftdi-la/api.c
index c258be1..2a64729 100644
--- a/src/hardware/ftdi-la/api.c
+++ b/src/hardware/ftdi-la/api.c
@@ -86,7 +86,7 @@ static const struct ftdi_chip_desc *chip_descs[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static void scan_device(struct sr_dev_driver *di, struct libusb_device *dev, GSList **devices)
diff --git a/src/hardware/fx2lafw/api.c b/src/hardware/fx2lafw/api.c
index e56f152..6f6c53f 100644
--- a/src/hardware/fx2lafw/api.c
+++ b/src/hardware/fx2lafw/api.c
@@ -183,7 +183,7 @@ SR_PRIV struct sr_dev_driver fx2lafw_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/gmc-mh-1x-2x/api.c b/src/hardware/gmc-mh-1x-2x/api.c
index 67ad40d..de3e9ea 100644
--- a/src/hardware/gmc-mh-1x-2x/api.c
+++ b/src/hardware/gmc-mh-1x-2x/api.c
@@ -68,7 +68,7 @@ static const uint32_t devopts_bd[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
/**
diff --git a/src/hardware/gwinstek-gds-800/api.c b/src/hardware/gwinstek-gds-800/api.c
index 5e4a67f..bd9461e 100644
--- a/src/hardware/gwinstek-gds-800/api.c
+++ b/src/hardware/gwinstek-gds-800/api.c
@@ -35,7 +35,7 @@ SR_PRIV struct sr_dev_driver gwinstek_gds_800_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
diff --git a/src/hardware/hameg-hmo/api.c b/src/hardware/hameg-hmo/api.c
index f75f55e..1e60a34 100644
--- a/src/hardware/hameg-hmo/api.c
+++ b/src/hardware/hameg-hmo/api.c
@@ -49,7 +49,7 @@ enum {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static int check_manufacturer(const char *manufacturer)
diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c
index ab866a4..838805d 100644
--- a/src/hardware/hantek-6xxx/api.c
+++ b/src/hardware/hantek-6xxx/api.c
@@ -165,7 +165,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c
index 6162d5c..c571573 100644
--- a/src/hardware/hantek-dso/api.c
+++ b/src/hardware/hantek-dso/api.c
@@ -256,7 +256,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/hp-3457a/api.c b/src/hardware/hp-3457a/api.c
index a5ff7d9..2d05f29 100644
--- a/src/hardware/hp-3457a/api.c
+++ b/src/hardware/hp-3457a/api.c
@@ -168,7 +168,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/hung-chang-dso-2100/api.c b/src/hardware/hung-chang-dso-2100/api.c
index eb2246f..e628c77 100644
--- a/src/hardware/hung-chang-dso-2100/api.c
+++ b/src/hardware/hung-chang-dso-2100/api.c
@@ -106,7 +106,7 @@ static const uint8_t coupling_map[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan_port(GSList *devices, struct sr_dev_driver *di,
diff --git a/src/hardware/ikalogic-scanalogic2/api.c b/src/hardware/ikalogic-scanalogic2/api.c
index 6a8e095..7f03a59 100644
--- a/src/hardware/ikalogic-scanalogic2/api.c
+++ b/src/hardware/ikalogic-scanalogic2/api.c
@@ -56,7 +56,7 @@ SR_PRIV struct sr_dev_driver ikalogic_scanalogic2_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c
index 898d7a3..e5b6cec 100644
--- a/src/hardware/ikalogic-scanaplus/api.c
+++ b/src/hardware/ikalogic-scanaplus/api.c
@@ -67,7 +67,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c
index 309b1b6..6a64b8f 100644
--- a/src/hardware/kecheng-kc-330b/api.c
+++ b/src/hardware/kecheng-kc-330b/api.c
@@ -65,7 +65,7 @@ SR_PRIV struct sr_dev_driver kecheng_kc_330b_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static int scan_kecheng(struct sr_dev_driver *di,
diff --git a/src/hardware/kern-scale/api.c b/src/hardware/kern-scale/api.c
index ef95430..ed55687 100644
--- a/src/hardware/kern-scale/api.c
+++ b/src/hardware/kern-scale/api.c
@@ -38,7 +38,7 @@ static const uint32_t devopts[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/korad-kaxxxxp/api.c b/src/hardware/korad-kaxxxxp/api.c
index 9a2b916..6f4ad65 100644
--- a/src/hardware/korad-kaxxxxp/api.c
+++ b/src/hardware/korad-kaxxxxp/api.c
@@ -66,7 +66,7 @@ SR_PRIV struct sr_dev_driver korad_kaxxxxp_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c
index ce61f46..78eab70 100644
--- a/src/hardware/lascar-el-usb/api.c
+++ b/src/hardware/lascar-el-usb/api.c
@@ -40,7 +40,7 @@ static const uint32_t devopts[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/lecroy-logicstudio/api.c b/src/hardware/lecroy-logicstudio/api.c
index 8e58bd0..303309b 100644
--- a/src/hardware/lecroy-logicstudio/api.c
+++ b/src/hardware/lecroy-logicstudio/api.c
@@ -75,7 +75,7 @@ SR_PRIV struct sr_dev_driver lecroy_logicstudio_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *create_device(struct sr_dev_driver *di,
diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c
index e25c557..ff51173 100644
--- a/src/hardware/link-mso19/api.c
+++ b/src/hardware/link-mso19/api.c
@@ -87,7 +87,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/manson-hcs-3xxx/api.c b/src/hardware/manson-hcs-3xxx/api.c
index 4ce5909..30180d3 100644
--- a/src/hardware/manson-hcs-3xxx/api.c
+++ b/src/hardware/manson-hcs-3xxx/api.c
@@ -77,7 +77,7 @@ SR_PRIV struct sr_dev_driver manson_hcs_3xxx_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/maynuo-m97/api.c b/src/hardware/maynuo-m97/api.c
index 59f9c7f..f8d615d 100644
--- a/src/hardware/maynuo-m97/api.c
+++ b/src/hardware/maynuo-m97/api.c
@@ -113,7 +113,7 @@ SR_PRIV struct sr_dev_driver maynuo_m97_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *probe_device(struct sr_modbus_dev_inst *modbus)
diff --git a/src/hardware/mic-985xx/api.c b/src/hardware/mic-985xx/api.c
index f6d77f0..70914e1 100644
--- a/src/hardware/mic-985xx/api.c
+++ b/src/hardware/mic-985xx/api.c
@@ -59,7 +59,7 @@ SR_PRIV const struct mic_dev_info mic_devs[] = {
static int init(struct sr_context *sr_ctx, int idx)
{
- return std_init(mic_devs[idx].di, sr_ctx, LOG_PREFIX);
+ return std_init(mic_devs[idx].di, sr_ctx);
}
static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
diff --git a/src/hardware/motech-lps-30x/api.c b/src/hardware/motech-lps-30x/api.c
index 8d87da0..d8aceb5 100644
--- a/src/hardware/motech-lps-30x/api.c
+++ b/src/hardware/motech-lps-30x/api.c
@@ -135,7 +135,7 @@ static const struct lps_modelspec models[] = {
static int init_lps301(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
/** Send command to device with va_list.
diff --git a/src/hardware/norma-dmm/api.c b/src/hardware/norma-dmm/api.c
index fa32fa6..ad099c9 100644
--- a/src/hardware/norma-dmm/api.c
+++ b/src/hardware/norma-dmm/api.c
@@ -67,7 +67,7 @@ static const char *get_typestr(int type, struct sr_dev_driver *drv)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *drv, GSList *options)
diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c
index 96a7cc0..bee4c3a 100644
--- a/src/hardware/openbench-logic-sniffer/api.c
+++ b/src/hardware/openbench-logic-sniffer/api.c
@@ -89,7 +89,7 @@ SR_PRIV struct sr_dev_driver ols_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c
index c4d0cf3..6a51986 100644
--- a/src/hardware/pipistrello-ols/api.c
+++ b/src/hardware/pipistrello-ols/api.c
@@ -79,7 +79,7 @@ SR_PRIV struct sr_dev_driver p_ols_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/rigol-ds/api.c b/src/hardware/rigol-ds/api.c
index 53208a7..ce8fa11 100644
--- a/src/hardware/rigol-ds/api.c
+++ b/src/hardware/rigol-ds/api.c
@@ -274,7 +274,7 @@ static int dev_clear(const struct sr_dev_driver *di)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
diff --git a/src/hardware/saleae-logic16/api.c b/src/hardware/saleae-logic16/api.c
index 5c587ef..5ca534b 100644
--- a/src/hardware/saleae-logic16/api.c
+++ b/src/hardware/saleae-logic16/api.c
@@ -97,7 +97,7 @@ static const uint64_t samplerates[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static gboolean check_conf_profile(libusb_device *dev)
diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c
index 01ae50c..c8904b6 100644
--- a/src/hardware/scpi-pps/api.c
+++ b/src/hardware/scpi-pps/api.c
@@ -43,7 +43,7 @@ static const struct pps_channel_instance pci[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c
index b16caa9..860062a 100644
--- a/src/hardware/serial-dmm/api.c
+++ b/src/hardware/serial-dmm/api.c
@@ -43,7 +43,7 @@ static const uint32_t devopts[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/sysclk-lwla/api.c b/src/hardware/sysclk-lwla/api.c
index 33992ff..a2e2993 100644
--- a/src/hardware/sysclk-lwla/api.c
+++ b/src/hardware/sysclk-lwla/api.c
@@ -65,7 +65,7 @@ static const char *const signal_edge_names[] = {
*/
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
/* Create a new sigrok device instance for the indicated LWLA model.
diff --git a/src/hardware/teleinfo/api.c b/src/hardware/teleinfo/api.c
index a99fd37..d9445e1 100644
--- a/src/hardware/teleinfo/api.c
+++ b/src/hardware/teleinfo/api.c
@@ -40,7 +40,7 @@ SR_PRIV struct sr_dev_driver teleinfo_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/testo/api.c b/src/hardware/testo/api.c
index 79a11b4..daf4965 100644
--- a/src/hardware/testo/api.c
+++ b/src/hardware/testo/api.c
@@ -45,7 +45,7 @@ static const struct testo_model models[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/tondaj-sl-814/api.c b/src/hardware/tondaj-sl-814/api.c
index 7c9c1bf..9b31e1d 100644
--- a/src/hardware/tondaj-sl-814/api.c
+++ b/src/hardware/tondaj-sl-814/api.c
@@ -43,7 +43,7 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c
index 1c1cd30..6e8663e 100644
--- a/src/hardware/uni-t-dmm/api.c
+++ b/src/hardware/uni-t-dmm/api.c
@@ -48,7 +48,7 @@ static const uint32_t devopts[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/uni-t-ut32x/api.c b/src/hardware/uni-t-ut32x/api.c
index 5e8be27..67a1551 100644
--- a/src/hardware/uni-t-ut32x/api.c
+++ b/src/hardware/uni-t-ut32x/api.c
@@ -41,7 +41,7 @@ SR_PRIV struct sr_dev_driver uni_t_ut32x_driver_info;
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/victor-dmm/api.c b/src/hardware/victor-dmm/api.c
index c00c29f..3557154 100644
--- a/src/hardware/victor-dmm/api.c
+++ b/src/hardware/victor-dmm/api.c
@@ -52,7 +52,7 @@ static const uint32_t devopts[] = {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/hardware/yokogawa-dlm/api.c b/src/hardware/yokogawa-dlm/api.c
index 547179d..91eea3e 100644
--- a/src/hardware/yokogawa-dlm/api.c
+++ b/src/hardware/yokogawa-dlm/api.c
@@ -65,7 +65,7 @@ enum {
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static struct sr_dev_inst *probe_usbtmc_device(struct sr_scpi_dev_inst *scpi)
diff --git a/src/hardware/zeroplus-logic-cube/api.c b/src/hardware/zeroplus-logic-cube/api.c
index 32c8689..a50ea3f 100644
--- a/src/hardware/zeroplus-logic-cube/api.c
+++ b/src/hardware/zeroplus-logic-cube/api.c
@@ -157,7 +157,7 @@ SR_PRIV int zp_set_samplerate(struct dev_context *devc, uint64_t samplerate)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static GSList *scan(struct sr_dev_driver *di, GSList *options)
diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h
index 328e170..588d090 100644
--- a/src/libsigrok-internal.h
+++ b/src/libsigrok-internal.h
@@ -859,8 +859,7 @@ SR_PRIV int sr_analog_init(struct sr_datafeed_analog *analog,
typedef int (*dev_close_callback)(struct sr_dev_inst *sdi);
typedef void (*std_dev_clear_callback)(void *priv);
-SR_PRIV int std_init(struct sr_dev_driver *di, struct sr_context *sr_ctx,
- const char *prefix);
+SR_PRIV int std_init(struct sr_dev_driver *di, struct sr_context *sr_ctx);
SR_PRIV int std_cleanup(const struct sr_dev_driver *di);
#ifdef HAVE_LIBSERIALPORT
SR_PRIV int std_serial_dev_open(struct sr_dev_inst *sdi);
diff --git a/src/session_driver.c b/src/session_driver.c
index c7f2b3d..e0dd3fc 100644
--- a/src/session_driver.c
+++ b/src/session_driver.c
@@ -208,7 +208,7 @@ static int receive_data(int fd, int revents, void *cb_data)
static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
- return std_init(di, sr_ctx, LOG_PREFIX);
+ return std_init(di, sr_ctx);
}
static int dev_clear(const struct sr_dev_driver *di)
diff --git a/src/std.c b/src/std.c
index 8f6f378..a03e509 100644
--- a/src/std.c
+++ b/src/std.c
@@ -41,20 +41,13 @@
*
* @param di The driver instance to use.
* @param sr_ctx The libsigrok context to assign.
- * @param[in] prefix A driver-specific prefix string used for log messages.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
*/
-SR_PRIV int std_init(struct sr_dev_driver *di, struct sr_context *sr_ctx,
- const char *prefix)
+SR_PRIV int std_init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
struct drv_context *drvc;
- if (!di) {
- sr_err("%s: Invalid driver, cannot initialize.", prefix);
- return SR_ERR_ARG;
- }
-
drvc = g_malloc0(sizeof(struct drv_context));
drvc->sr_ctx = sr_ctx;
drvc->instances = NULL;