X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fzeroplus.c;h=875291ee9a63de5574fee21165e3a56cb11c0409;hb=340cfac0f0629aa3ee84a0a4db53381d04079fe3;hp=9b867dca43e134da40f30a3d989caad7ddaef0d9;hpb=86f5e3d826fc9059e110f07221cb1a30652ceac2;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 9b867dca..875291ee 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -370,12 +370,19 @@ static int hw_opendev(int device_index) return SR_OK; } -static void hw_closedev(int device_index) +static int hw_closedev(int device_index) { struct sr_device_instance *sdi; - if ((sdi = sr_get_device_instance(device_instances, device_index))) - close_device(sdi); + if (!(sdi = sr_get_device_instance(device_instances, device_index))) { + sr_err("lap-c: %s: sdi was NULL", __func__); + return SR_ERR; /* TODO: SR_ERR_ARG? */ + } + + /* TODO */ + close_device(sdi); + + return SR_OK; } static void hw_cleanup(void) @@ -519,7 +526,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) sr_session_bus(session_device_id, &packet); if (!(buf = g_try_malloc(PACKET_SIZE))) { - sr_err("zeroplus: %s: buf malloc failed", __func__); + sr_err("lap-c: %s: buf malloc failed", __func__); return SR_ERR_MALLOC; }