aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gpib/pc2 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-08-19staging: gpib: tidy-up commentsLuke Yang1-2/+2
Improve comment readability: - "//comment" -> "// comment" - Align comments vertically in columns - Enforce consistency between "// comments" and "/* comments */" Signed-off-by: Luke Yang <lukeyang.dev@gmail.com> Link: https://lore.kernel.org/r/aJ4ykOs_MmjnQdPa@luyang-thinkpadp1gen7.toromso.csb Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-18staging: gpib: Add return value to request_controlDave Penkler1-2/+2
A number of drivers are unable to release control due to hardware or software limitations. As request_system_control was defined as void, no error could be signalled. This patch changes the prototype of request_system_control to int and adds the appropriate checking and returns. In the case that a board cannot release control EINVAL is returned. If a driver does not implement request_system_control EPERM is returned. Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250418133537.22491-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-17staging: gpib: pc2: struct gpib_interfaceMichael Rubin1-4/+4
Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin <matchstick@neverthere.org> Link: https://lore.kernel.org/r/20250417003246.84445-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-17staging: gpib: pc2: u8 over uint8_tMichael Rubin1-8/+8
Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin <matchstick@neverthere.org> Link: https://lore.kernel.org/r/20250417004533.86765-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-15staging: gpib: pc2: fixes multiline comments stylePaul Retourné1-2/+3
Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul Retourné <paul.retourne@orange.fr> Link: https://lore.kernel.org/r/77eb5fc5050298503009fa212600f00514eeb713.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-15staging: gpib: pc2: struct gpib_board_configMichael Rubin1-6/+6
Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin <matchstick@neverthere.org> Link: https://lore.kernel.org/r/20250408223659.187109-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-15staging: gpib: pc2: lines exceeded 100 columnsMichael Rubin1-1/+2
Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin <matchstick@neverthere.org> Link: https://lore.kernel.org/r/20250408222040.186881-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-20staging: gpib: change return type of t1_delay function to report errorsRodrigo Gobbi1-1/+1
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 <rodrigo.gobbi.7@gmail.com> Link: https://lore.kernel.org/r/20250225014811.77995-1-rodrigo.gobbi.7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-20staging: gpib: pc2: struct gpib_boardMichael Rubin1-34/+34
Using Linux code style for struct gpib_board. Adhering to Linux code style. In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin <matchstick@neverthere.org> Acked-By: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250319215924.19387-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-19staging: gpib: pc2 console messaging cleanupDave Penkler1-23/+28
Enable module name to be printed in pr_xxx and dev_xxx Turn long pr_err into comment, short message in dev_err. Change pr_err to dev_err where possible. Use error return codes consistent with messages. Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250214114708.28947-16-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-03staging: gpib: Make static, reduce fwd declarationsDave Penkler1-128/+119
A number of drivers were unnecessarily not declaring their entry points as static. Declare them as static. In order to reduce the number of forward declarations the gpib interface structure initializations have been moved to after the code of the entry points that they use. This also makes the structure of the drivers to be more consistent between them. Signed-off-by: Dave Penkler <dpenkler@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20250122103859.25499-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-03staging: gpib: fix prefixing 0x with decimal outputAjith P V1-1/+1
- pr_err() of pc2a_common_attach() in pc2_gpib uses 0x%d. - The config->ibbase is of u32 and correct prefix is 0x%x. - This error reported by checkpatch with below message: ERROR: Prefixing 0x with decimal output is defective Signed-off-by: Ajith P V <ajithpv.linux@gmail.com> Link: https://lore.kernel.org/r/20250122075545.33146-1-ajithpv.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-15staging: gpib: Avoid plain integers as NULL pointersDave Penkler1-1/+1
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 <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250114165403.16410-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-13staging: gpib: Modernize gpib_interface_t initialization and make staticDave Penkler1-104/+104
All interface drivers were using the old style initialization of this struct field : value; This generated the followng sparse warning, for example: agilent_82357a/agilent_82357a.c:1492:1: warning: obsolete struct initializer, use C99 syntax Change the initialization to use the C99 syntax .field = value; This also resolves the checkpatch constraint of no indentation These structs were also not declared as static, unnecessarily polluting the symbol namespace and generating the following sparse warnings, for example: agilent_82357a/agilent_82357a.c:1465:18: warning: symbol 'agilent_82357a_gpib_interface' was not declared. Should it be static? Declare them as static and remove any conflicting extern declarations in the corresponding include files. Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20250111160514.26954-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-13Merge 6.13-rc7 into staging nextGreg Kroah-Hartman2-9/+9
We need the gpib changes in here as well to build on top of. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-07staging: gpib: pc2: Handle gpib_register_driver() errorsNihar Chaithanya1-4/+34
The function gpib_register_driver() can fail, resulting in a semi-registered module and does not return an error value if it fails. Unregister the previous gpib registering functions if subsequent gpib_register_driver() fail and return the error value. Add pr_err() statements indicating the fail and error value. Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com> Link: https://lore.kernel.org/r/20241230185633.175690-15-niharchaithanya@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-20staging: gpib: fix address space mixupArnd Bergmann1-8/+8
Throughout the gpib drivers, a 'void *' struct member is used in place of either port numbers or __iomem pointers, which leads to lots of extra type casts, sparse warnings and less portable code. Split the struct member in two separate ones with the correct types, so each driver can pick which one to use. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/all/f10e976e-7a04-4454-b38d-39cd18f142da@roeck-us.net/ Link: https://lore.kernel.org/r/20241213064959.1045243-3-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-20staging: gpib: fix MakefilesArnd Bergmann1-1/+1
Having gpib drivers built-in rather than as loadable modules causes link failure because the drivers are never actually built: arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_t1_delay': fmh_gpib.c:(.text+0x3b0): undefined reference to `nec7210_t1_delay' arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_serial_poll_status': fmh_gpib.c:(.text+0x418): undefined reference to `nec7210_serial_poll_status' arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_secondary_address': fmh_gpib.c:(.text+0x57c): undefined reference to `nec7210_secondary_address' arm-linux-gnueabi-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_primary_address': fmh_gpib.c:(.text+0x5ac): undefined reference to `nec7210_primary_address' Change this to use the correct Makefile syntax, setting either obj-m or obj-y. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20241212154245.1411411-2-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19staging: gpib: pc2: avoid calling undefined dma_free()Arnd Bergmann1-0/+4
On architectures that don't support the ISA DMA API, this causes a build failure. The corresponding dma_alloc() call is already in an #ifdef, so use the same one for dma_free(). Note that nothing seems to set PC2_DMA, so parts of this driver are likely unused. ISA DMA usually does not work on PCI or PCMCIA devices, only on physical ISA slots. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20241016111521.1143191-4-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-19staging: gpib: add module descriptionsArnd Bergmann1-0/+1
Every loadable module should have a description, and not having one causes a W=1 build warning, so add these to the newly added modules. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20241016111521.1143191-2-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-10staging: gpib: Add pc2 GPIB driverDave Penkler2-0/+656
Driver for pc2 compatible boards for Computer Equipment Corporation, Hameg and ohters Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20240918121908.19366-21-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>