]> sigrok.org Git - libsigrok.git/blobdiff - hwdriver.c
Remove sr_driver_hwcap_exists().
[libsigrok.git] / hwdriver.c
index 9bb097e80ca260e742008e68ef1e0a5423d4cd64..189b0331031a6a289ed45374617156a9a9acfc60 100644 (file)
@@ -316,7 +316,7 @@ SR_PRIV struct sr_config *sr_config_make(int key, const void *value)
  *         but this is not to be flagged as an error by the caller; merely
  *         as an indication that it's not applicable.
  */
-SR_API int sr_info_get(struct sr_dev_driver *driver, int id,
+SR_API int sr_config_get(struct sr_dev_driver *driver, int id,
                const void **data, const struct sr_dev_inst *sdi)
 {
        int ret;
@@ -329,35 +329,20 @@ SR_API int sr_info_get(struct sr_dev_driver *driver, int id,
        return ret;
 }
 
-/**
- * Find out if a hardware driver has a specific capability.
- *
- * @param driver The hardware driver in which to search for the capability.
- * @param hwcap The capability to find in the list.
- *
- * @return TRUE if the specified capability exists in the specified driver,
- *         FALSE otherwise. Also, if 'driver' is NULL or the respective driver
- *         returns an invalid capability list, FALSE is returned.
- */
-SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
+SR_API int sr_config_list(struct sr_dev_driver *driver, int id,
+               const void **data, const struct sr_dev_inst *sdi)
 {
-       const int *hwcaps;
-       int i;
+       int ret;
 
-       if (!driver) {
-               sr_err("hwdriver: %s: driver was NULL", __func__);
-               return FALSE;
-       }
+       if (driver == NULL || data == NULL)
+               return SR_ERR;
 
-       if (driver->config_get(SR_DI_HWCAPS, (const void **)&hwcaps, NULL) != SR_OK)
-               return FALSE;
+       if (!driver->config_list)
+               return SR_ERR;
 
-       for (i = 0; hwcaps[i]; i++) {
-               if (hwcaps[i] == hwcap)
-                       return TRUE;
-       }
+       ret = driver->config_list(id, data, sdi);
 
-       return FALSE;
+       return ret;
 }
 
 /**