X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fdrivers.c;h=9b970fcc06ef88935a89732f2c618cc8824dd2af;hb=HEAD;hp=7641e24d0d31f4cca76a094fbafffebfef2ebc7f;hpb=393375e1fee969e7c80feac0cb1df718bd652578;p=libsigrok.git diff --git a/src/drivers.c b/src/drivers.c index 7641e24d..6dc2c55c 100644 --- a/src/drivers.c +++ b/src/drivers.c @@ -25,19 +25,22 @@ #include "libsigrok-internal.h" /* - * sr_driver_list is a special section contains pointers to all the hardware - * drivers built into the library. The __start and __stop symbols are - * created from driver_list_start.c and driver_list_stop.c, and point to the - * start and end of the section. They are used to iterate over the list of - * all drivers. + * The special __sr_driver_list section contains pointers to all hardware + * drivers which were built into the library according to its configuration + * (will depend on the availability of dependencies, as well as user provided + * specs). The __start and __stop symbols point to the start and end of the + * section. They are used to iterate over the list of all drivers which were + * included in the library. */ SR_PRIV extern const struct sr_dev_driver *sr_driver_list__start[]; SR_PRIV extern const struct sr_dev_driver *sr_driver_list__stop[]; -/** @private +/** * Initialize the driver list in a fresh libsigrok context. * * @param ctx Pointer to a libsigrok context struct. Must not be NULL. + * + * @private */ SR_API void sr_drivers_init(struct sr_context *ctx) { @@ -49,6 +52,5 @@ SR_API void sr_drivers_init(struct sr_context *ctx) drivers < sr_driver_list__stop; drivers++) g_array_append_val(array, *drivers); #endif - ctx->driver_list = (struct sr_dev_driver **)array->data; - g_array_free(array, FALSE); + ctx->driver_list = (struct sr_dev_driver **)g_array_free(array, FALSE); }