]> git.ipfire.org Git - thirdparty/linux.git/commit
comedi: pcl812: Add sanity checks for I/O base address
authorIan Abbott <abbotti@mev.co.uk>
Fri, 30 Jan 2026 16:48:01 +0000 (16:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 13:49:39 +0000 (15:49 +0200)
commitc24543463720ae8eb3aa1b35ff957fc96870cb94
treea42c11bf8360ec8b9435df7a6905d257cd2ddb98
parentb5218a9897f5c381f513ea906a65655977a9c1b3
comedi: pcl812: Add sanity checks for I/O base address

The "pcl812" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
analog/digital I/O ISA boards from Advantech, ADLINK, and ICP DAS.  It
currently allows any base address to be configured but the hardware
devices only support base addresses (configured by on-board DIP
switches) from 0 or 0x200 (depending on the model) to 0x3F0 on 16-byte
boundaries.

Store the minimum supported I/O base addresses in the static board
information array elements and add a sanity check to ensure the device
is not configured at an unsupported base address.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20260130170416.49994-37-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/comedi/drivers/pcl812.c