return SR_OK;
}
-/* Returns the next enabled channel, wrapping around if necessary. */
-/** @private */
+/**
+ * Returns the next enabled channel, wrapping around if necessary.
+ *
+ * @param[in] sdi The device instance the channel is connected to.
+ * Must not be NULL.
+ * @param[in] cur_channel The current channel.
+ *
+ * @return A pointer to the next enabled channel of this device.
+ *
+ * @private
+ */
SR_PRIV struct sr_channel *sr_next_enabled_channel(const struct sr_dev_inst *sdi,
-
struct sr_channel *cur_channel)
{
struct sr_channel *next_channel;
*/
SR_API int sr_dev_clear(const struct sr_dev_driver *driver)
{
- int ret;
-
if (!driver) {
sr_err("Invalid driver.");
return SR_ERR_ARG;
/* No log message here, too verbose and not very useful. */
- if (driver->dev_clear)
- ret = driver->dev_clear(driver);
- else
- ret = std_dev_clear(driver, NULL);
-
- return ret;
+ return driver->dev_clear(driver);
}
/**
*/
SR_API int sr_dev_close(struct sr_dev_inst *sdi)
{
- int ret;
-
if (!sdi || !sdi->driver || !sdi->driver->dev_close)
return SR_ERR_ARG;
sr_dbg("%s: Closing device instance.", sdi->driver->name);
- ret = sdi->driver->dev_close(sdi);
-
- return ret;
+ return sdi->driver->dev_close(sdi);
}
/**
if (b != usb->bus || a != usb->address)
continue;
- usb_get_port_path(devlist[i], connection_id, sizeof(connection_id));
+ if (usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)) < 0)
+ continue;
+
((struct sr_dev_inst *)sdi)->connection_id = g_strdup(connection_id);
break;
}