X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=device.c;h=3166ea8e0c087d72431ab7269d80e0308109c2cf;hb=f8b07fc6c37cc40dbcc3c6bc607d6e3137b532e4;hp=24ec602f90a21686bb42da96d712af4df36b73c3;hpb=c09f0b578c0e9c03590cb814f66004bb3f6815ff;p=libsigrok.git diff --git a/device.c b/device.c index 24ec602f..3166ea8e 100644 --- a/device.c +++ b/device.c @@ -55,17 +55,17 @@ static GSList *devs = NULL; * TODO: Error checks? * TODO: Option to only scan for specific devices or device classes. * - * @return SR_OK upon success, SR_ERR upon errors. + * @return SR_OK upon success, SR_ERR_BUG upon internal errors. */ SR_API int sr_dev_scan(void) { int i; struct sr_dev_driver **drivers; - drivers = sr_hw_list(); + drivers = sr_driver_list(); if (!drivers[0]) { sr_err("dev: %s: no supported hardware drivers", __func__); - return SR_ERR; /* TODO: More specific error? */ + return SR_ERR_BUG; } /* @@ -74,7 +74,7 @@ SR_API int sr_dev_scan(void) * of these out of the way first. */ for (i = 0; drivers[i]; i++) - sr_hw_init(drivers[i]); + sr_driver_init(drivers[i]); return SR_OK; } @@ -238,8 +238,6 @@ SR_API struct sr_probe *sr_dev_probe_find(const struct sr_dev *dev, * If the probe already has a different name assigned to it, it will be * removed, and the new name will be saved instead. * - * TODO: Rename to sr_dev_probe_name_set(). - * * @param dev TODO * @param probenum The number of the probe whose name to set. * Note that the probe numbers start at 1 (not 0!). @@ -249,8 +247,8 @@ SR_API struct sr_probe *sr_dev_probe_find(const struct sr_dev *dev, * upon other errors. * If something other than SR_OK is returned, 'dev' is unchanged. */ -SR_API int sr_dev_probe_name(struct sr_dev *dev, int probenum, - const char *name) +SR_API int sr_dev_probe_name_set(struct sr_dev *dev, int probenum, + const char *name) { struct sr_probe *p;