staging: gpib: Correct check for max secondary address
authorDave Penkler <dpenkler@gmail.com>
Mon, 4 Nov 2024 17:50:13 +0000 (18:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Nov 2024 08:27:35 +0000 (09:27 +0100)
commit7c8a7d2f88caeaa376964b57243e26e018ad656d
tree642876114e926d90f9839687867c9e5d27a6ea7e
parent3c2ae0cbaf341e579892f2a67f7701931de949b4
staging: gpib: Correct check for max secondary address

GPIB secondary addresses can be between 0 and 31 inclusive
unlike primary addresses where address 31 is not a valid device
address.  When 31 is used as a primary talk address it
forms the UNT (Untalk) command and when used as a listener address it
forms the UNL (Unlisten) commmand.
The library was incorrectly not allowing a secondary address
with a value of 31 to be used.

Fixes: 9dde4559e939 ("staging: gpib: Add GPIB common core driver")
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20241104175014.12317-13-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/common/gpib_os.c
drivers/staging/gpib/common/iblib.c
drivers/staging/gpib/common/ibsys.h