]> sigrok.org Git - libsigrok.git/commit - src/hardware/serial-dmm/api.c
serial-dmm: Simplify wrapper layout
authorAlexandru Gagniuc <redacted>
Thu, 13 Dec 2012 14:58:01 +0000 (08:58 -0600)
committerUwe Hermann <redacted>
Thu, 13 Dec 2012 22:16:34 +0000 (23:16 +0100)
commit3098b3902d1794831be010ebff0484caf845de60
tree1cda607ab48a01d1bbd45c3c63d0412acabcb163
parentfd9b2b865ac4e3f12305744753c0759c34c056c4
serial-dmm: Simplify wrapper layout

Wrappers for hw_init, hw_cleanup, clear_instances, and hw_scan are needed for
each subdriver due to the nature of serial-dmm. These wrappers are implemented
as macros, in order to reduce the number of lines of code.

For each of those functions, we have a separate wrapper list, then we connect
them together in a first-class driver using a DRV macro, and yet another list
(the DRV list).

Instead of declaring those wrappers in separate lists, include them in the DRV
macro. This approach reduces the number of macro lists from five to just one.

From the perspective of adding a new subdriver, this also greatly reduces the
number of places needed to hook in a new device.

Signed-off-by: Alexandru Gagniuc <redacted>
hardware/serial-dmm/api.c