staging: comedi: ni_routes: Refactor ni_find_valid_routes()
authorIan Abbott <abbotti@mev.co.uk>
Fri, 7 Feb 2020 15:13:57 +0000 (15:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Feb 2020 18:25:06 +0000 (10:25 -0800)
commit075a329591540affcc32af0da09abd54549e1659
treee96e2bfc39f46958a852a6c3c96ace6ea21236bb
parent0e3ee7f10af9b3c6994c530048d5115d3c67c801
staging: comedi: ni_routes: Refactor ni_find_valid_routes()

Split out the loops in `ni_find_valid_routes()` into separate functions:

* ni_find_route_values(device_family) to find the list of route values
  for a device family (e.g "ni-mseries"); and
* ni_find_valid_routes(board_name) to find the set of valid routes for a
  board name.

The functions above return `NULL` if the information is not found (as we
do not currently have the routing information available for all
supported boards).

Cc: Éric Piel <piel@delmic.com>
Cc: Spencer E. Olson <olsonse@umich.edu>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20200207151400.272678-2-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_routes.c