drivers: Add and use STD_CONFIG_LIST(). This ensures consistent handling of the SR_CONF_SCAN_OPTIONS and SR_CONF_DEVICE_OPTIONS (with sdi NULL or non-NULL) config keys and also reduces copy-pasted boilerplate in the drivers a bit. This function does not handle channel-group specific items, that's very driver-specific and thus left to the individual drivers. Also move some generic checks and error messages from the drivers into the sr_config_list() wrapper.
Remove unnecessary std_serial_dev_acquisition_stop() wrappers Now that std_serial_dev_acquisition_stop() has the same signature as the sr_dev_driver dev_acquisition_stop() callback it is possible to remove the wrapper functions and use std_serial_dev_acquisition_stop() directly has the callback function. Signed-off-by: Lars-Peter Clausen <redacted>
std_serial_dev_acquisition_stop(): Remove dev_close_fn parameter All callers of std_serial_dev_acquisition_stop() currently pass the same callback for the dev_close_fn parameter as the dev_close callback of their sr_dev_driver struct. Remove the dev_close_fn parameter and invoke the drivers dev_close() callback directly. This simplifies the API and ensures consistent behaviour between different drivers. Signed-off-by: Lars-Peter Clausen <redacted>
std_serial_dev_acquisition_stop(): Remove serial parameter All callers of std_serial_dev_acquisition_stop() currently pass sdi->conn for the serial parameter. And the other std_serial helper functions already require that the conn field of the sr_driver_inst passed to the functions points to the sr_serial_dev_inst associated with the device. Modify std_serial_dev_acquisition_stop() to follow the same pattern and remove the serial parameter. This simplifies the API and ensures consistent behaviour between different drivers. Signed-off-by: Lars-Peter Clausen <redacted>
Use driver name as the log prefix in standard functions Some of the standard helper functions take a log prefix parameter that is used when printing messages. This log prefix is almost always identical to the name field in the driver's sr_dev_driver struct. The only exception are drivers which register multiple sr_dev_driver structs. Instead of passing the log prefix as a parameter simply use the driver's name. This simplifies the API, gives consistent behaviour between different drivers and also makes it easier to identify where the message originates when a driver registers sr_dev_driver structs. Signed-off-by: Lars-Peter Clausen <redacted>