[PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors

Nihar Chaithanya posted 15 patches 1 year, 1 month ago
There is a newer version of this series
[PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
Posted by Nihar Chaithanya 1 year, 1 month ago
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 platform driver, pci and gpib registering
functions if subsequent gpib_register_driver() fail and return the
error value.

Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
 drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 43 +++++++++++++++++-------
 1 file changed, 31 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
index 62791db1c34a..30676f139a61 100644
--- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
+++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
@@ -1690,24 +1690,43 @@ static int __init fmh_gpib_init_module(void)
 	int result;
 
 	result = platform_driver_register(&fmh_gpib_platform_driver);
-	if (result) {
-		pr_err("fmh_gpib: platform_driver_register failed!\n");
+	if (result)
 		return result;
-	}
 
 	result = pci_register_driver(&fmh_gpib_pci_driver);
-	if (result) {
-		pr_err("fmh_gpib: pci_driver_register failed!\n");
-		return result;
-	}
+	if (result)
+		goto err_pci_driver;
+
+	result = gpib_register_driver(&fmh_gpib_unaccel_interface, THIS_MODULE);
+	if (result)
+		goto err_unaccel;
 
-	gpib_register_driver(&fmh_gpib_unaccel_interface, THIS_MODULE);
-	gpib_register_driver(&fmh_gpib_interface, THIS_MODULE);
-	gpib_register_driver(&fmh_gpib_pci_unaccel_interface, THIS_MODULE);
-	gpib_register_driver(&fmh_gpib_pci_interface, THIS_MODULE);
+	result = gpib_register_driver(&fmh_gpib_interface, THIS_MODULE);
+	if (result)
+		goto err_interface;
+
+	result = gpib_register_driver(&fmh_gpib_pci_unaccel_interface, THIS_MODULE);
+	if (result)
+		goto err_pci_unaccel;
+
+	result = gpib_register_driver(&fmh_gpib_pci_interface, THIS_MODULE);
+	if (result)
+		goto err_pci;
 
-	pr_info("fmh_gpib\n");
 	return 0;
+
+err_pci:
+	gpib_unregister_driver(&fmh_gpib_pci_unaccel_interface);
+err_pci_unaccel:
+	gpib_unregister_driver(&fmh_gpib_interface);
+err_interface:
+	gpib_unregister_driver(&fmh_gpib_unaccel_interface);
+err_unaccel:
+	pci_unregister_driver(&fmh_gpib_pci_driver);
+err_pci_driver:
+	platform_driver_unregister(&fmh_gpib_platform_driver);
+
+	return result;
 }
 
 static void __exit fmh_gpib_exit_module(void)
-- 
2.34.1
Re: [PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
Posted by kernel test robot 1 year, 1 month ago
Hi Nihar,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Nihar-Chaithanya/staging-gpib-Modify-gpib_register_driver-to-return-error-if-it-fails/20241227-035743
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20241226193637.241049-8-niharchaithanya%40gmail.com
patch subject: [PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20241227/202412271054.Oy0QXjPZ-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241227/202412271054.Oy0QXjPZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412271054.Oy0QXjPZ-lkp@intel.com/

All errors (new ones prefixed by >>):

   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_t1_delay':
   fmh_gpib.c:(.text+0x512): undefined reference to `nec7210_t1_delay'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_serial_poll_status':
   fmh_gpib.c:(.text+0x606): undefined reference to `nec7210_serial_poll_status'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_secondary_address':
   fmh_gpib.c:(.text+0xa56): undefined reference to `nec7210_secondary_address'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_primary_address':
   fmh_gpib.c:(.text+0xb0e): undefined reference to `nec7210_primary_address'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_update_status':
   fmh_gpib.c:(.text+0xb8e): undefined reference to `nec7210_update_status'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll_response':
   fmh_gpib.c:(.text+0xc0e): undefined reference to `nec7210_parallel_poll_response'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll':
   fmh_gpib.c:(.text+0xc8e): undefined reference to `nec7210_parallel_poll'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll_configure':
   fmh_gpib.c:(.text+0xd0e): undefined reference to `nec7210_parallel_poll_configure'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_disable_eos':
   fmh_gpib.c:(.text+0xd86): undefined reference to `nec7210_disable_eos'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_enable_eos':
   fmh_gpib.c:(.text+0xe16): undefined reference to `nec7210_enable_eos'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_remote_enable':
   fmh_gpib.c:(.text+0xece): undefined reference to `nec7210_remote_enable'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_interface_clear':
   fmh_gpib.c:(.text+0xf4e): undefined reference to `nec7210_interface_clear'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_request_system_control':
   fmh_gpib.c:(.text+0xfce): undefined reference to `nec7210_request_system_control'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_go_to_standby':
   fmh_gpib.c:(.text+0x1046): undefined reference to `nec7210_go_to_standby'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_take_control':
   fmh_gpib.c:(.text+0x10ce): undefined reference to `nec7210_take_control'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_command':
   fmh_gpib.c:(.text+0x115a): undefined reference to `nec7210_command'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_write':
   fmh_gpib.c:(.text+0x1224): undefined reference to `nec7210_write'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_read':
   fmh_gpib.c:(.text+0x12e4): undefined reference to `nec7210_read'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_device_match':
   fmh_gpib.c:(.text+0x146c): undefined reference to `gpib_match_device_path'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init.isra.0':
   fmh_gpib.c:(.text+0x25d6): undefined reference to `nec7210_board_reset'
   s390-linux-ld: fmh_gpib.c:(.text+0x260a): undefined reference to `nec7210_set_handshake_mode'
   s390-linux-ld: fmh_gpib.c:(.text+0x2722): undefined reference to `nec7210_board_online'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_pci_attach_impl':
   fmh_gpib.c:(.text+0x28f2): undefined reference to `gpib_pci_get_device'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_pci_detach':
   fmh_gpib.c:(.text+0x386c): undefined reference to `nec7210_board_reset'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_detach':
   fmh_gpib.c:(.text+0x3b8e): undefined reference to `nec7210_board_reset'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_fifo_read_countable':
   fmh_gpib.c:(.text+0x4452): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: fmh_gpib.c:(.text+0x4468): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: fmh_gpib.c:(.text+0x47c8): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_fifo_write_countable':
   fmh_gpib.c:(.text+0x5294): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: fmh_gpib.c:(.text+0x52aa): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:fmh_gpib.c:(.text+0x52fe): more undefined references to `nec7210_set_reg_bits' follow
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_internal_interrupt':
   fmh_gpib.c:(.text+0x6012): undefined reference to `push_gpib_event'
   s390-linux-ld: fmh_gpib.c:(.text+0x6040): undefined reference to `nec7210_interrupt_have_status'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_callback':
   fmh_gpib.c:(.text+0x6564): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_fifo_read':
   fmh_gpib.c:(.text+0x66d6): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_write':
   fmh_gpib.c:(.text+0x6f62): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: fmh_gpib.c:(.text+0x6f78): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: fmh_gpib.c:(.text+0x744c): undefined reference to `nec7210_set_reg_bits'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:fmh_gpib.c:(.text+0x8142): more undefined references to `nec7210_set_reg_bits' follow
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_exit_module':
   fmh_gpib.c:(.exit.text+0x2e): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: fmh_gpib.c:(.exit.text+0x3a): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: fmh_gpib.c:(.exit.text+0x46): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: fmh_gpib.c:(.exit.text+0x52): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init_module':
   fmh_gpib.c:(.init.text+0x9e): undefined reference to `gpib_register_driver'
   s390-linux-ld: fmh_gpib.c:(.init.text+0xce): undefined reference to `gpib_register_driver'
   s390-linux-ld: fmh_gpib.c:(.init.text+0x102): undefined reference to `gpib_register_driver'
   s390-linux-ld: fmh_gpib.c:(.init.text+0x132): undefined reference to `gpib_register_driver'
>> s390-linux-ld: fmh_gpib.c:(.init.text+0x15c): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: fmh_gpib.c:(.init.text+0x16e): undefined reference to `gpib_unregister_driver'
   s390-linux-ld: fmh_gpib.c:(.init.text+0x180): undefined reference to `gpib_unregister_driver'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
Posted by kernel test robot 1 year, 1 month ago
Hi Nihar,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Nihar-Chaithanya/staging-gpib-Modify-gpib_register_driver-to-return-error-if-it-fails/20241227-035743
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20241226193637.241049-8-niharchaithanya%40gmail.com
patch subject: [PATCH v4 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
config: loongarch-randconfig-001-20241227 (https://download.01.org/0day-ci/archive/20241227/202412270718.ELKIIc5I-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241227/202412270718.ELKIIc5I-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412270718.ELKIIc5I-lkp@intel.com/

All errors (new ones prefixed by >>):

   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_t1_delay':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:262:(.text+0x388): undefined reference to `nec7210_t1_delay'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_serial_poll_status':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:211:(.text+0x3e0): undefined reference to `nec7210_serial_poll_status'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_secondary_address':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:133:(.text+0x3f0): undefined reference to `nec7210_secondary_address'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_primary_address':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:126:(.text+0x3fc): undefined reference to `nec7210_primary_address'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_update_status':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:119:(.text+0x408): undefined reference to `nec7210_update_status'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll_response':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:154:(.text+0x414): undefined reference to `nec7210_parallel_poll_response'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:140:(.text+0x420): undefined reference to `nec7210_parallel_poll'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_parallel_poll_configure':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:147:(.text+0x42c): undefined reference to `nec7210_parallel_poll_configure'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_disable_eos':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:112:(.text+0x434): undefined reference to `nec7210_disable_eos'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_enable_eos':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:105:(.text+0x444): undefined reference to `nec7210_enable_eos'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_remote_enable':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:98:(.text+0x450): undefined reference to `nec7210_remote_enable'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_interface_clear':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:91:(.text+0x45c): undefined reference to `nec7210_interface_clear'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_request_system_control':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:84:(.text+0x468): undefined reference to `nec7210_request_system_control'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_go_to_standby':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:76:(.text+0x470): undefined reference to `nec7210_go_to_standby'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_take_control':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:69:(.text+0x47c): undefined reference to `nec7210_take_control'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_command':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:62:(.text+0x490): undefined reference to `nec7210_command'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_write':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:54:(.text+0x4a8): undefined reference to `nec7210_write'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_read':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:46:(.text+0x4c0): undefined reference to `nec7210_read'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_detach':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1512:(.text+0x63c): undefined reference to `nec7210_board_reset'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_internal_interrupt':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1166:(.text+0x720): undefined reference to `push_gpib_event'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1170:(.text+0x73c): undefined reference to `nec7210_interrupt_have_status'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_device_match':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1370:(.text+0x924): undefined reference to `gpib_match_device_path'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_callback':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:363:(.text+0xeb8): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_fifo_write_countable':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:607:(.text+0xf88): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:608:(.text+0xf9c): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:631:(.text+0x1034): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:648:(.text+0x1140): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:drivers/staging/gpib/fmh_gpib/fmh_gpib.c:649: more undefined references to `nec7210_set_reg_bits' follow
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_pci_detach':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1637:(.text+0x166c): undefined reference to `nec7210_board_reset'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1342:(.text+0x1978): undefined reference to `nec7210_board_reset'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1344:(.text+0x1998): undefined reference to `nec7210_set_handshake_mode'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1351:(.text+0x19c8): undefined reference to `nec7210_board_online'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_pci_attach_impl':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1545:(.text+0x1cbc): undefined reference to `gpib_pci_get_device'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_write':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:426:(.text+0x1f20): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:427:(.text+0x1f34): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:453:(.text+0x2070): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_read':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:761:(.text+0x23ac): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:762:(.text+0x23c0): undefined reference to `nec7210_set_reg_bits'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:drivers/staging/gpib/fmh_gpib/fmh_gpib.c:787: more undefined references to `nec7210_set_reg_bits' follow
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_exit_module':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1734:(.exit.text+0x18): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1735:(.exit.text+0x20): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1736:(.exit.text+0x28): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1737:(.exit.text+0x30): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init_module':
   drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1700:(.init.text+0x70): undefined reference to `gpib_register_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1704:(.init.text+0x88): undefined reference to `gpib_register_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1708:(.init.text+0xa0): undefined reference to `gpib_register_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1712:(.init.text+0xb4): undefined reference to `gpib_register_driver'
>> loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1719:(.init.text+0xc4): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1721:(.init.text+0xcc): undefined reference to `gpib_unregister_driver'
   loongarch64-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1723:(.init.text+0xd4): undefined reference to `gpib_unregister_driver'

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki