* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include "protocol.h"
/* serial protocol */
static const char mso_foot[] = { 0x7e };
extern SR_PRIV struct sr_dev_driver link_mso19_driver_info;
-static struct sr_dev_driver *di = &link_mso19_driver_info;
SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial,
uint16_t payload[], int n)
if (serial->fd < 0)
goto ret;
- if (!(buf = g_try_malloc(s))) {
- sr_err("Failed to malloc message buffer.");
- ret = SR_ERR_MALLOC;
- goto ret;
- }
+ buf = g_malloc(s);
p = buf;
memcpy(p, mso_head, sizeof(mso_head));
return mso_send_control_message(devc->serial, ARRAY_AND_SIZE(ops));
}
-SR_PRIV inline uint16_t mso_calc_raw_from_mv(struct dev_context * devc)
+SR_PRIV uint16_t mso_calc_raw_from_mv(struct dev_context *devc)
{
return (uint16_t) (0x200 -
((devc->dso_trigger_voltage / devc->dso_probe_attn) /
sr_dbg("Requesting trigger state.");
ret = mso_send_control_message(serial, ARRAY_AND_SIZE(ops));
- if (info == NULL || ret != SR_OK)
+ if (!info || ret != SR_OK)
return ret;
uint8_t buf = 0;
GSList *l;
int i;
- struct drv_context *drvc = di->priv;
+ struct drv_context *drvc = di->context;
/* Find this device's devc struct by its fd. */
struct dev_context *devc = NULL;