]> sigrok.org Git - libsigrok.git/commit
sr_driver_init(): Improve checks.
authorUwe Hermann <redacted>
Mon, 28 Jan 2013 18:36:16 +0000 (19:36 +0100)
committerUwe Hermann <redacted>
Tue, 29 Jan 2013 11:56:02 +0000 (12:56 +0100)
commitc0eea11c4535e071c72b357fa7e2d1288104c134
tree71bcb9cab3d72b3c9276692d3367c4a93c9976c9
parentbd36d826d4b9916034c6268919e2a72a0d7ea000
sr_driver_init(): Improve checks.

Check the relevant arguments for != NULL before calling the actual
driver-specific function, so that the driver can safely assume those
arguments are non-NULL. This removes the need to duplicate these
checks in every driver.

Also, change one SR_ERR to the more correct SR_ERR_MALLOC, and assign
sr_ctx in the rigol-ds1xx2's hw_init() function, like all the other
drivers do.
hardware/asix-sigma/asix-sigma.c
hardware/colead-slm/api.c
hardware/demo/demo.c
hardware/openbench-logic-sniffer/api.c
hardware/rigol-ds1xx2/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/zeroplus.c
hwdriver.c