Some drivers check in some of their driver callbacks if the driver has been initialized and return an error if it has not. For the scan() callback the sigrok core checks if the driver has been initialized and if not returns an error. So it is not possible that the scan() callback gets called if the driver is not initialized. Without the scan() callback succeeding it is not possible to get a reference to a device which is associated with the driver, so it is not possible that any of the device specific callbacks is called without the driver first being initialized either. In conclusion these checks are not necessary since they never evaluate to true and can be dropped. If they should ever become necessary they should be done in the sigrok core so all drivers and all callbacks are equally handled. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> |
||
---|---|---|
.. | ||
api.c | ||
protocol.c | ||
protocol.h |