A common task during device scan is to add the newly discovered devices to the instance list of the driver. Currently this is done by each driver on its own. This patch introduces a new helper function std_scan_complete() which takes care of this. The function should be called at the end of a driver's scan() callback before returning the device list. Doing this with a helper function provides guaranteed consistent behaviour among drivers and hopefully paves the way to moving more standard functionality directly into the sigrok core. Another common task that every driver has to do for each device instance is to initialize the device's driver field. So this is done in the new helper function as well. All drivers that can make use of the new helper are updated. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> |
||
---|---|---|
.. | ||
api.c | ||
protocol.c | ||
protocol.h |