| ed375186 | 25-Feb-2025 |
Rodrigo Gobbi <[email protected]> |
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay co
staging: gpib: change return type of t1_delay function to report errors
The current code returns "unsigned int" and it doesn't handle errors correctly if it happens during ioctl call for t1 delay configuration.
The ni_usb_t1_delay(), from NI, is the only function returning -1 at this point. The caller, t1_delay_ioctl(), doesn't check for errors and sets board->t1_nano_sec to -1 and returns success. The board->t1_nano_sec value is also used in ni_usb_setup_t1_delay() besides the ioctl call and a value of -1 is treated as being above 1100ns. It may or may not have a noticeable effect, but it's obviously not right considering the content of ni_usb_setup_t1_delay().
Typical delays are in the 200-2000 range, but definitely not more than INT_MAX so we can fix this code by changing the return type to int and adding a check for errors. While we're at it, lets change the error code in ni_usb_t1_delay() from -1 and instead propagate the error from ni_usb_write_registers().
Fixes: 4e127de14fa7 ("staging: gpib: Add National Instruments USB GPIB driver") Signed-off-by: Rodrigo Gobbi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 20a351c3 | 20-Feb-2025 |
Dave Penkler <[email protected]> |
staging: gpib: tnt4882 console messaging cleanup
Enable module name to be printed in pr_xxx and dev_xxx Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded string "tnt4882_gpib" in pci_driv
staging: gpib: tnt4882 console messaging cleanup
Enable module name to be printed in pr_xxx and dev_xxx Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded string "tnt4882_gpib" in pci_driver struct, request_region and request_irq.
Remove unsupported chipset pr_err's
Remove messages on interrupted or timed out reads and writes.
Remove board not found messages and return -ENODEV
Remove "tnt4882:" prefix in messages as it will be printed by pr_fmt and dev_fmt.
Change pr_err to dev_err where possible.
Remove irq and chipset pr_info's.
Replace error messages with appropriate error returns.
Remove call to mite_list_devices() and the function in mite.c
Remove PCMCIA debug comments, PCMCIA_DEBUG conditional compilation symbol, the DEBUG macro definition and its uses.
Remove pr_info's in mite.c
Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| b3beeeee | 14-Jan-2025 |
Dave Penkler <[email protected]> |
staging: gpib: Avoid plain integers as NULL pointers
A number of drivers were comparing request_region() with 0, others were passing 0 instead of NULL as a pointer argument.
This led to the followi
staging: gpib: Avoid plain integers as NULL pointers
A number of drivers were comparing request_region() with 0, others were passing 0 instead of NULL as a pointer argument.
This led to the following sparse warning, for example:
cb7210/cb7210.c:1043:72: warning: Using plain integer as NULL pointer
Use !request_region() to test for NULL return and use NULL instead of 0 as pointer parameter.
Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 6f79db02 | 08-Jan-2025 |
Greg Kroah-Hartman <[email protected]> |
staging: gpib: mite: remove unused global functions
The mite.c file was originally copied from the COMEDI code, and now that it is in the kernel tree, along with the comedi code, on some build confi
staging: gpib: mite: remove unused global functions
The mite.c file was originally copied from the COMEDI code, and now that it is in the kernel tree, along with the comedi code, on some build configurations there are errors due to duplicate symbols (specifically mite_dma_disarm).
Remove all of the unused functions in the gpib mite.c and .h files as they aren't needed and cause the compiler to be confused.
Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Reported-by: Stephen Rothwell <[email protected]> Link: https://lore.kernel.org/r/2025010809-padding-survive-91b3@gregkh Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 84b172ce | 07-Jan-2025 |
Lukas Bulwahn <[email protected]> |
staging: gpib: refer to correct config symbol in tnt4882 Makefile
Commit 79d2e1919a27 ("staging: gpib: fix Makefiles") uses the corresponding config symbols to let Makefiles include the driver sourc
staging: gpib: refer to correct config symbol in tnt4882 Makefile
Commit 79d2e1919a27 ("staging: gpib: fix Makefiles") uses the corresponding config symbols to let Makefiles include the driver sources appropriately in the kernel build.
Unfortunately, the Makefile in the tnt4882 directory refers to the non-existing config GPIB_TNT4882. The actual config name for this driver is GPIB_NI_PCI_ISA, as can be observed in the gpib Makefile.
Probably, this is caused by the subtle differences between the config names, directory names and file names in ./drivers/staging/gpib/, where often config names and directory names are identical or at least close in naming, but in this case, it is not.
Change the reference in the tnt4882 Makefile from the non-existing config GPIB_TNT4882 to the existing config GPIB_NI_PCI_ISA.
Fixes: 79d2e1919a27 ("staging: gpib: fix Makefiles") Signed-off-by: Lukas Bulwahn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| fec866a0 | 13-Dec-2024 |
Arnd Bergmann <[email protected]> |
staging: gpib: use ioport_map
The tnt4882 backend has a rather elabolate way of abstracting the PIO and MMIO based hardware variants, duplicating the functionality of ioport_map() in a less portable
staging: gpib: use ioport_map
The tnt4882 backend has a rather elabolate way of abstracting the PIO and MMIO based hardware variants, duplicating the functionality of ioport_map() in a less portable way.
Change it to use ioport_map() with ioread8()/iowrite8() to do this more easily.
Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| b8989f45 | 16-Oct-2024 |
Arnd Bergmann <[email protected]> |
staging: gpib: avoid unused const variables
Variables that are 'static const' but not used anywhere cause a warning with "gcc -Wunused-const-variable", which we may want to enable by default in the
staging: gpib: avoid unused const variables
Variables that are 'static const' but not used anywhere cause a warning with "gcc -Wunused-const-variable", which we may want to enable by default in the future.
The gpib code already has a mix of 'enum' and 'static const' variables for named constants, so convert the ones that are causing problems to enums as well, or move them closer to the only users where possible.
Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|