Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: comedi: ni_mio_common: Allow alternate board name for routes

We do not have or do not provide routing information for all supported
boards. Some of the boards for which we do not provide routing
information actually have routes that are identical to a similar board
for which we already provide routing information.

To allow boards to share identical routing information, add an
`alt_route_name` member to `struct ni_board_struct`. This will be
initialized to `NULL` for all boards except those that will use make use
of the identical routing information that has been provided for a
similar board, in which case it will name that board. Pass the
`alt_route_name` member value to `ni_assign_device_routes()` as the
`alt_board_name` parameter, which it will use if no routing information
could be found for the actual board name.

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-4-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ian Abbott and committed by
Greg Kroah-Hartman
9bfd8bc5 e3b7ce73

+3 -1
+2 -1
drivers/staging/comedi/drivers/ni_mio_common.c
··· 5974 5974 : "ni_eseries"; 5975 5975 5976 5976 /* prepare the device for globally-named routes. */ 5977 - if (ni_assign_device_routes(dev_family, board->name, NULL, 5977 + if (ni_assign_device_routes(dev_family, board->name, 5978 + board->alt_route_name, 5978 5979 &devpriv->routing_tables) < 0) { 5979 5980 dev_warn(dev->class_dev, "%s: %s device has no signal routing table.\n", 5980 5981 __func__, board->name);
+1
drivers/staging/comedi/drivers/ni_stc.h
··· 941 941 942 942 struct ni_board_struct { 943 943 const char *name; 944 + const char *alt_route_name; 944 945 int device_id; 945 946 int isapnp_id; 946 947