* [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors
@ 2024-12-30 18:56 Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
` (14 more replies)
0 siblings, 15 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
While reviewing the patch for fixing Coverity scan issue from
gpib: cb7210 [1], Greg pointed out that the gpib_register_driver()
function can fail and must return an error value if it fails.
This patch series fixes the above issue by changing the return type
of gpib_register_driver() function and returning the error value if
it fails.
This fix also makes sure that wherever the gpib_register_driver() is
called and if it fails - the previous driver register functions are
unregistered (if they exist) and the error value is returned. The
pr_err() statements are added indicating the fail and the error value.
Thanks,
Nihar
v5 --> v6 : Removed unnecessary pr_info() statements when the drivers are
working properly. Added pr_err() in all cases of the driver
registration fail - indicating the failure and also the
error value.
v4 --> v5 : Added pr_* statements indicating when the driver register
functions fail or if the module is initialized without errors.
v3 --> v4 : Made the v3 patch into series and also fixed an error in
v3 [2]. Each patch in this series is a fix for particular
driver handling the gpib_register_driver() error.
v2 --> v3 : Modified the gpib_register_driver() to return error code,
added error handling to all the places that the
gpib_register_driver() is called.
v1 --> v2 : Replaced the redundant cb_pcmcia_init_module() with
pcmcia_register_driver().
Link to v5 : https://lore.kernel.org/all/20241228060800.107653-1-niharchaithanya@gmail.com/
Link to v4 : https://lore.kernel.org/all/20241226193637.241049-1-niharchaithanya@gmail.com/
Link to v3 : https://lore.kernel.org/all/20241221214822.163667-1-niharchaithanya@gmail.com/
Link to v2 : https://lore.kernel.org/all/20241221091121.35476-1-niharchaithanya@gmail.com/
Link to v1 : https://lore.kernel.org/all/20241221022632.20931-1-niharchaithanya@gmail.com/
[1] https://lore.kernel.org/all/2024122133-outskirts-causing-099a@gregkh/
[2] https://lore.kernel.org/all/202412221424.WIjKFIPf-lkp@intel.com/
Nihar Chaithanya (15):
staging: gpib: Modify gpib_register_driver() to return error if it
fails
staging: gpib: agilent_82350b: Handle gpib_register_driver() errors
staging: gpib: agilent_82357a: Handle gpib_register_driver() errors
staging: gpib: cb7210: Handle gpib_register_driver() errors
staging: gpib: cec: Handle gpib_register_driver() errors
staging: gpib: fluke: Handle gpib_register_driver() errors
staging: gpib: fmh: Handle gpib_register_driver() errors
staging: gpib: gpio: Return error value from gpib_register_driver()
staging: gpib: hp_82335: Return error value from
gpib_register_driver()
staging: gpib: hp_82341: Handle gpib_register_driver() errors
staging: gpib: ines: Handle gpib_register_driver() errors
staging: gpib: lpvo_usb: Return error value from
gpib_register_driver()
staging: gpib: ni_usb: Handle gpib_register_driver() errors
staging: gpib: pc2: Handle gpib_register_driver() errors
staging: gpib: tnt4882: Handle gpib_register_driver() errors
.../gpib/agilent_82350b/agilent_82350b.c | 23 +++-
.../gpib/agilent_82357a/agilent_82357a.c | 16 ++-
drivers/staging/gpib/cb7210/cb7210.c | 116 ++++++++++++++----
drivers/staging/gpib/cec/cec_gpib.c | 8 +-
drivers/staging/gpib/common/gpib_os.c | 7 +-
drivers/staging/gpib/eastwood/fluke_gpib.c | 32 ++++-
drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 47 +++++--
drivers/staging/gpib/gpio/gpib_bitbang.c | 7 +-
drivers/staging/gpib/hp_82335/hp82335.c | 8 +-
drivers/staging/gpib/hp_82341/hp_82341.c | 17 ++-
drivers/staging/gpib/include/gpibP.h | 2 +-
drivers/staging/gpib/ines/ines_gpib.c | 94 ++++++++++----
.../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 6 +-
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 15 ++-
drivers/staging/gpib/pc2/pc2_gpib.c | 38 +++++-
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 106 ++++++++++++++--
16 files changed, 447 insertions(+), 95 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v6 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 02/15] staging: gpib: agilent_82350b: Handle gpib_register_driver() errors Nihar Chaithanya
` (13 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail if kmalloc() fails,
but it doesn't return any error if that happens.
Modify the function to return error i.e int. Return the appropriate
error code if it fails. Remove the pr_info() statement.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/common/gpib_os.c | 7 ++++---
drivers/staging/gpib/include/gpibP.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c
index 405237d8cb47..07795df3b721 100644
--- a/drivers/staging/gpib/common/gpib_os.c
+++ b/drivers/staging/gpib/common/gpib_os.c
@@ -2094,18 +2094,19 @@ void init_gpib_descriptor(gpib_descriptor_t *desc)
atomic_set(&desc->io_in_progress, 0);
}
-void gpib_register_driver(gpib_interface_t *interface, struct module *provider_module)
+int gpib_register_driver(gpib_interface_t *interface, struct module *provider_module)
{
struct gpib_interface_list_struct *entry;
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry)
- return;
+ return -ENOMEM;
entry->interface = interface;
entry->module = provider_module;
list_add(&entry->list, ®istered_drivers);
- pr_info("gpib: registered %s interface\n", interface->name);
+
+ return 0;
}
EXPORT_SYMBOL(gpib_register_driver);
diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h
index 5fc42b645ab7..d0cd42c1a0ad 100644
--- a/drivers/staging/gpib/include/gpibP.h
+++ b/drivers/staging/gpib/include/gpibP.h
@@ -17,7 +17,7 @@
#include <linux/fs.h>
#include <linux/interrupt.h>
-void gpib_register_driver(gpib_interface_t *interface, struct module *mod);
+int gpib_register_driver(gpib_interface_t *interface, struct module *mod);
void gpib_unregister_driver(gpib_interface_t *interface);
struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned int vendor_id,
unsigned int device_id, struct pci_dev *from);
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 02/15] staging: gpib: agilent_82350b: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 03/15] staging: gpib: agilent_82357a: " Nihar Chaithanya
` (12 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail which can result in
semi-registered module.
In case gpib_register_driver() fails unregister the previous
gpib and pci registering functions, return the error value.
Add pr_err() when registering driver fails also indicate the error
value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
.../gpib/agilent_82350b/agilent_82350b.c | 23 ++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
index 53006d0cc79c..e9c1f0100b2a 100644
--- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
+++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c
@@ -910,13 +910,30 @@ static int __init agilent_82350b_init_module(void)
result = pci_register_driver(&agilent_82350b_pci_driver);
if (result) {
- pr_err("agilent_82350b: pci_driver_register failed!\n");
+ pr_err("agilent_82350b: pci_register_driver failed: error = %d\n", result);
return result;
}
- gpib_register_driver(&agilent_82350b_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&agilent_82350b_interface, THIS_MODULE);
+ result = gpib_register_driver(&agilent_82350b_unaccel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("agilent_82350b: gpib_register_driver failed: error = %d\n", result);
+ goto err_unaccel;
+ }
+
+ result = gpib_register_driver(&agilent_82350b_interface, THIS_MODULE);
+ if (result) {
+ pr_err("agilent_82350b: gpib_register_driver failed: error = %d\n", result);
+ goto err_interface;
+ }
+
return 0;
+
+err_interface:
+ gpib_unregister_driver(&agilent_82350b_unaccel_interface);
+err_unaccel:
+ pci_unregister_driver(&agilent_82350b_pci_driver);
+
+ return result;
}
static void __exit agilent_82350b_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 03/15] staging: gpib: agilent_82357a: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 02/15] staging: gpib: agilent_82350b: Handle gpib_register_driver() errors Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 04/15] staging: gpib: cb7210: " Nihar Chaithanya
` (11 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.
In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err when registering driver
fails also indicating the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
.../staging/gpib/agilent_82357a/agilent_82357a.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
index bf05fb4a736b..261fb6d2e991 100644
--- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
+++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c
@@ -1691,12 +1691,24 @@ static struct usb_driver agilent_82357a_bus_driver = {
static int __init agilent_82357a_init_module(void)
{
int i;
+ int ret;
pr_info("agilent_82357a_gpib driver loading");
for (i = 0; i < MAX_NUM_82357A_INTERFACES; ++i)
agilent_82357a_driver_interfaces[i] = NULL;
- usb_register(&agilent_82357a_bus_driver);
- gpib_register_driver(&agilent_82357a_gpib_interface, THIS_MODULE);
+
+ ret = usb_register(&agilent_82357a_bus_driver);
+ if (ret) {
+ pr_err("agilent_82357a: usb_register failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&agilent_82357a_gpib_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("agilent_82357a: gpib_register_driver failed: error = %d\n", ret);
+ usb_deregister(&agilent_82357a_bus_driver);
+ return ret;
+ }
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 04/15] staging: gpib: cb7210: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (2 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 03/15] staging: gpib: agilent_82357a: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 05/15] staging: gpib: cec: " Nihar Chaithanya
` (10 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function cb_pcmcia_init_module() can be replaced by calling
pcmcia_register_driver() directly. The error value from this
function is not returned and the previous registering functions
are not unregistered.
The function gpib_register_driver() can fail and similar to
pcmcia_register_driver() function failing, the previous registering
functions are not unregistered.
Replace cb_pcmcia_init_module() with pcmcia_register_driver().
Unregister the gpib and pci register functions if the subsequent
gpib or pcmcia register functions fail and return the error value.
Add pr_err() statements to indicate the fail and also the error
value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/cb7210/cb7210.c | 116 +++++++++++++++++++++------
1 file changed, 90 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c
index 63df7f3eb3f3..45a54219ea6d 100644
--- a/drivers/staging/gpib/cb7210/cb7210.c
+++ b/drivers/staging/gpib/cb7210/cb7210.c
@@ -1351,12 +1351,6 @@ static struct pcmcia_driver cb_gpib_cs_driver = {
.resume = cb_gpib_resume,
};
-int cb_pcmcia_init_module(void)
-{
- pcmcia_register_driver(&cb_gpib_cs_driver);
- return 0;
-}
-
void cb_pcmcia_cleanup_module(void)
{
DEBUG(0, "cb_gpib_cs: unloading\n");
@@ -1506,32 +1500,102 @@ void cb_pcmcia_detach(gpib_board_t *board)
static int __init cb7210_init_module(void)
{
- int err = 0;
- int result;
+ int ret;
+
+ ret = pci_register_driver(&cb7210_pci_driver);
+ if (ret) {
+ pr_err("cb7210: pci_register_driver failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&cb_pci_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci;
+ }
+
+ ret = gpib_register_driver(&cb_isa_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_isa;
+ }
- result = pci_register_driver(&cb7210_pci_driver);
- if (result) {
- pr_err("cb7210: pci_driver_register failed!\n");
- return result;
+ ret = gpib_register_driver(&cb_pci_accel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci_accel;
}
- gpib_register_driver(&cb_pci_interface, THIS_MODULE);
- gpib_register_driver(&cb_isa_interface, THIS_MODULE);
- gpib_register_driver(&cb_pci_accel_interface, THIS_MODULE);
- gpib_register_driver(&cb_pci_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&cb_isa_accel_interface, THIS_MODULE);
- gpib_register_driver(&cb_isa_unaccel_interface, THIS_MODULE);
-
-#ifdef GPIB__PCMCIA
- gpib_register_driver(&cb_pcmcia_interface, THIS_MODULE);
- gpib_register_driver(&cb_pcmcia_accel_interface, THIS_MODULE);
- gpib_register_driver(&cb_pcmcia_unaccel_interface, THIS_MODULE);
- err += cb_pcmcia_init_module();
+ ret = gpib_register_driver(&cb_pci_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci_unaccel;
+ }
+
+ ret = gpib_register_driver(&cb_isa_accel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_isa_accel;
+ }
+
+ ret = gpib_register_driver(&cb_isa_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_isa_unaccel;
+ }
+
+#ifdef GPIB_PCMCIA
+ ret = gpib_register_driver(&cb_pcmcia_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia;
+ }
+
+ ret = gpib_register_driver(&cb_pcmcia_accel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_accel;
+ }
+
+ ret = gpib_register_driver(&cb_pcmcia_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("cb7210: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_unaccel;
+ }
+
+ ret = pcmcia_register_driver(&cb_gpib_cs_driver);
+ if (ret) {
+ pr_err("cb7210: pcmcia_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_driver;
+ }
#endif
- if (err)
- return -1;
return 0;
+
+#ifdef GPIB_PCMCIA
+err_pcmcia_driver:
+ gpib_unregister_driver(&cb_pcmcia_unaccel_interface);
+err_pcmcia_unaccel:
+ gpib_unregister_driver(&cb_pcmcia_accel_interface);
+err_pcmcia_accel:
+ gpib_unregister_driver(&cb_pcmcia_interface);
+err_pcmcia:
+#endif
+ gpib_unregister_driver(&cb_isa_unaccel_interface);
+err_isa_unaccel:
+ gpib_unregister_driver(&cb_isa_accel_interface);
+err_isa_accel:
+ gpib_unregister_driver(&cb_pci_unaccel_interface);
+err_pci_unaccel:
+ gpib_unregister_driver(&cb_pci_accel_interface);
+err_pci_accel:
+ gpib_unregister_driver(&cb_isa_interface);
+err_isa:
+ gpib_unregister_driver(&cb_pci_interface);
+err_pci:
+ pci_unregister_driver(&cb7210_pci_driver);
+
+ return ret;
}
static void __exit cb7210_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 05/15] staging: gpib: cec: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (3 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 04/15] staging: gpib: cb7210: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 06/15] staging: gpib: fluke: " Nihar Chaithanya
` (9 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail and result in a
semi-registered module and does not return an error value if it
fails.
Unregister the pci registering function in case gpib_register_driver()
fails and return the error value. Add pr_err() statements indicating the
fail and also the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/cec/cec_gpib.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c
index 3dc933deb401..e5b0941872f5 100644
--- a/drivers/staging/gpib/cec/cec_gpib.c
+++ b/drivers/staging/gpib/cec/cec_gpib.c
@@ -365,11 +365,15 @@ static int __init cec_init_module(void)
result = pci_register_driver(&cec_pci_driver);
if (result) {
- pr_err("cec_gpib: pci_driver_register failed!\n");
+ pr_err("cec_gpib: pci_register_driver failed: error = %d\n", result);
return result;
}
- gpib_register_driver(&cec_pci_interface, THIS_MODULE);
+ result = gpib_register_driver(&cec_pci_interface, THIS_MODULE);
+ if (result) {
+ pr_err("cec_gpib: gpib_register_driver failed: error = %d\n", result);
+ return result;
+ }
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 06/15] staging: gpib: fluke: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (4 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 05/15] staging: gpib: cec: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 07/15] staging: gpib: fmh: " Nihar Chaithanya
` (8 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
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 and gpib registering
functions if subsequent gpib_register_driver() fail and return the
error value. Add pr_err() statements indicating the fail and the error
value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/eastwood/fluke_gpib.c | 32 ++++++++++++++++++----
1 file changed, 27 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c
index 3f938ab0c84d..875b3adcb584 100644
--- a/drivers/staging/gpib/eastwood/fluke_gpib.c
+++ b/drivers/staging/gpib/eastwood/fluke_gpib.c
@@ -1155,16 +1155,38 @@ static int __init fluke_init_module(void)
result = platform_driver_register(&fluke_gpib_platform_driver);
if (result) {
- pr_err("fluke_gpib: platform_driver_register failed!\n");
+ pr_err("fluke_gpib: platform_driver_register failed: error = %d\n", result);
return result;
}
- gpib_register_driver(&fluke_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&fluke_hybrid_interface, THIS_MODULE);
- gpib_register_driver(&fluke_interface, THIS_MODULE);
+ result = gpib_register_driver(&fluke_unaccel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_unaccel;
+ }
+
+ result = gpib_register_driver(&fluke_hybrid_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_hybrid;
+ }
+
+ result = gpib_register_driver(&fluke_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fluke_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_interface;
+ }
- pr_info("fluke_gpib\n");
return 0;
+
+err_interface:
+ gpib_unregister_driver(&fluke_hybrid_interface);
+err_hybrid:
+ gpib_unregister_driver(&fluke_unaccel_interface);
+err_unaccel:
+ platform_driver_unregister(&fluke_gpib_platform_driver);
+
+ return result;
}
static void __exit fluke_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (5 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 06/15] staging: gpib: fluke: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-31 4:13 ` kernel test robot
2024-12-30 18:56 ` [PATCH v6 08/15] staging: gpib: gpio: Return error value from gpib_register_driver() Nihar Chaithanya
` (7 subsequent siblings)
14 siblings, 1 reply; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
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. Add pr_err() statements indicating the fail and also the
error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 47 ++++++++++++++++++++----
1 file changed, 39 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
index 62791db1c34a..90108ce0304a 100644
--- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
+++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c
@@ -1691,23 +1691,54 @@ static int __init fmh_gpib_init_module(void)
result = platform_driver_register(&fmh_gpib_platform_driver);
if (result) {
- pr_err("fmh_gpib: platform_driver_register failed!\n");
+ pr_err("fmh_gpib: platform_driver_register failed: error = %d\n", result);
return result;
}
result = pci_register_driver(&fmh_gpib_pci_driver);
if (result) {
- pr_err("fmh_gpib: pci_driver_register failed!\n");
- return result;
+ pr_err("fmh_gpib: pci_register_driver failed: error = %d\n", result);
+ goto err_pci_driver;
+ }
+
+ result = gpib_register_driver(&fmh_gpib_unaccel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_unaccel;
+ }
+
+ result = gpib_register_driver(&fmh_gpib_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_interface;
}
- 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_pci_unaccel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_pci_unaccel;
+ }
+
+ result = gpib_register_driver(&fmh_gpib_pci_interface, THIS_MODULE);
+ if (result) {
+ pr_err("fmh_gpib: gpib_register_driver failed: error = %d\n", 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
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 08/15] staging: gpib: gpio: Return error value from gpib_register_driver()
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (6 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 07/15] staging: gpib: fmh: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 09/15] staging: gpib: hp_82335: " Nihar Chaithanya
` (6 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail and does not return an
error value if it fails.
Return the error value if gpib_register_driver() fails. Add pr_err()
statement indicating the fail and also the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/gpio/gpib_bitbang.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c
index a2d562cbd65b..057f9264de34 100644
--- a/drivers/staging/gpib/gpio/gpib_bitbang.c
+++ b/drivers/staging/gpib/gpio/gpib_bitbang.c
@@ -1341,7 +1341,12 @@ return_to_local : bb_return_to_local,
static int __init bb_init_module(void)
{
- gpib_register_driver(&bb_interface, THIS_MODULE);
+ int result = gpib_register_driver(&bb_interface, THIS_MODULE);
+
+ if (result) {
+ pr_err("gpib_bitbang: gpib_register_driver failed: error = %d\n", result);
+ return result;
+ }
dbg_printk(0, "module loaded with pin map \"%s\"%s\n",
pin_map, (sn7516x_used) ? " and SN7516x driver support" : "");
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 09/15] staging: gpib: hp_82335: Return error value from gpib_register_driver()
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (7 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 08/15] staging: gpib: gpio: Return error value from gpib_register_driver() Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 10/15] staging: gpib: hp_82341: Handle gpib_register_driver() errors Nihar Chaithanya
` (5 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail and does not return an
error value if it fails.
Return the error value if gpib_register_driver() fails. Add pr_err()
statement indicating the fail and also the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/hp_82335/hp82335.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c
index 40afe42aea47..45157ad65d53 100644
--- a/drivers/staging/gpib/hp_82335/hp82335.c
+++ b/drivers/staging/gpib/hp_82335/hp82335.c
@@ -325,7 +325,13 @@ void hp82335_detach(gpib_board_t *board)
static int __init hp82335_init_module(void)
{
- gpib_register_driver(&hp82335_interface, THIS_MODULE);
+ int result = gpib_register_driver(&hp82335_interface, THIS_MODULE);
+
+ if (result) {
+ pr_err("hp82335: gpib_register_driver failed: error = %d\n", result);
+ return result;
+ }
+
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 10/15] staging: gpib: hp_82341: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (8 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 09/15] staging: gpib: hp_82335: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 11/15] staging: gpib: ines: " Nihar Chaithanya
` (4 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail, resulting in a
semi-registered module and does not return an error value if it
fails.
Return the error value if the first gpib_register_driver() fails
and if the second gpib_register_driver() fails unregister the first
gpib_register_driver() and return the error value. Add pr_err()
statements indicating the fail and the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/hp_82341/hp_82341.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c
index 8ad1c885a9fb..4953dac1e177 100644
--- a/drivers/staging/gpib/hp_82341/hp_82341.c
+++ b/drivers/staging/gpib/hp_82341/hp_82341.c
@@ -807,8 +807,21 @@ MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);
static int __init hp_82341_init_module(void)
{
- gpib_register_driver(&hp_82341_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&hp_82341_interface, THIS_MODULE);
+ int ret;
+
+ ret = gpib_register_driver(&hp_82341_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("hp_82341: gpib_register_driver failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&hp_82341_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("hp_82341: gpib_register_driver failed: error = %d\n", ret);
+ gpib_unregister_driver(&hp_82341_unaccel_interface);
+ return ret;
+ }
+
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 11/15] staging: gpib: ines: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (9 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 10/15] staging: gpib: hp_82341: Handle gpib_register_driver() errors Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 12/15] staging: gpib: lpvo_usb: Return error value from gpib_register_driver() Nihar Chaithanya
` (3 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function ines_pcmcia_init_module() can be replaced by calling
pcmcia_register_driver() directly. The error value from this
function is not returned and the previous registering functions
are not unregistered.
The function gpib_register_driver() can fail and similar to
pcmcia_register_driver() function failing, the previous registering
functions are not unregistered.
Replace cb_pcmcia_init_module() with pcmcia_register_driver().
Unregister the gpib and pci register functions if the subsequent
gpib or pcmcia register functions fail and return the error value.
Add pr_err() statements indicating the fail and error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/ines/ines_gpib.c | 94 +++++++++++++++++++++------
1 file changed, 73 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c
index 9d8387c3bf01..9d4bbb8e8a75 100644
--- a/drivers/staging/gpib/ines/ines_gpib.c
+++ b/drivers/staging/gpib/ines/ines_gpib.c
@@ -1227,12 +1227,6 @@ static struct pcmcia_driver ines_gpib_cs_driver = {
.resume = ines_gpib_resume,
};
-int ines_pcmcia_init_module(void)
-{
- pcmcia_register_driver(&ines_gpib_cs_driver);
- return 0;
-}
-
void ines_pcmcia_cleanup_module(void)
{
DEBUG(0, "ines_cs: unloading\n");
@@ -1420,28 +1414,86 @@ void ines_pcmcia_detach(gpib_board_t *board)
static int __init ines_init_module(void)
{
- int err = 0;
+ int ret;
+
+ ret = pci_register_driver(&ines_pci_driver);
+ if (ret) {
+ pr_err("ines_gpib: pci_register_driver failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&ines_pci_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci;
+ }
- err = pci_register_driver(&ines_pci_driver);
- if (err) {
- pr_err("ines_gpib: pci_driver_register failed!\n");
- return err;
+ ret = gpib_register_driver(&ines_pci_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci_unaccel;
+ }
+
+ ret = gpib_register_driver(&ines_pci_accel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pci_accel;
+ }
+
+ ret = gpib_register_driver(&ines_isa_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_isa;
}
- gpib_register_driver(&ines_pci_interface, THIS_MODULE);
- gpib_register_driver(&ines_pci_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&ines_pci_accel_interface, THIS_MODULE);
- gpib_register_driver(&ines_isa_interface, THIS_MODULE);
#ifdef GPIB_PCMCIA
- gpib_register_driver(&ines_pcmcia_interface, THIS_MODULE);
- gpib_register_driver(&ines_pcmcia_unaccel_interface, THIS_MODULE);
- gpib_register_driver(&ines_pcmcia_accel_interface, THIS_MODULE);
- err += ines_pcmcia_init_module();
+ ret = gpib_register_driver(&ines_pcmcia_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia;
+ }
+
+ ret = gpib_register_driver(&ines_pcmcia_unaccel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_unaccel;
+ }
+
+ ret = gpib_register_driver(&ines_pcmcia_accel_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ines_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_accel;
+ }
+
+ ret = pcmcia_register_driver(&ines_gpib_cs_driver);
+ if (ret) {
+ pr_err("ines_gpib: pcmcia_register_driver failed: error = %d\n", ret);
+ goto err_pcmcia_driver;
+ }
#endif
- if (err)
- return -1;
return 0;
+
+#ifdef GPIB_PCMCIA
+err_pcmcia_driver:
+ gpib_unregister_driver(&ines_pcmcia_accel_interface);
+err_pcmcia_accel:
+ gpib_unregister_driver(&ines_pcmcia_unaccel_interface);
+err_pcmcia_unaccel:
+ gpib_unregister_driver(&ines_pcmcia_interface);
+err_pcmcia:
+#endif
+ gpib_unregister_driver(&ines_isa_interface);
+err_isa:
+ gpib_unregister_driver(&ines_pci_accel_interface);
+err_pci_accel:
+ gpib_unregister_driver(&ines_pci_unaccel_interface);
+err_pci_unaccel:
+ gpib_unregister_driver(&ines_pci_interface);
+err_pci:
+ pci_unregister_driver(&ines_pci_driver);
+
+ return ret;
}
static void __exit ines_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 12/15] staging: gpib: lpvo_usb: Return error value from gpib_register_driver()
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (10 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 11/15] staging: gpib: ines: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 13/15] staging: gpib: ni_usb: Handle gpib_register_driver() errors Nihar Chaithanya
` (2 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The function gpib_register_driver() can fail and does not return an
error value if it fails.
Return the error value if gpib_register_driver() fails. Add pr_err()
statement indicating the fail and error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
index 796c3a5be545..5e279d41e3f9 100644
--- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
+++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
@@ -1181,7 +1181,11 @@ static int usb_gpib_init_module(struct usb_interface *interface)
return rv;
if (!assigned_usb_minors) {
- gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
+ rv = gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
+ if (rv) {
+ pr_err("lpvo_usb_gpib: gpib_register_driver failed: error = %d\n", rv);
+ goto exit;
+ }
} else {
/* check if minor is already registered - maybe useless, but if
* it happens the code is inconsistent somewhere
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 13/15] staging: gpib: ni_usb: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (11 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 12/15] staging: gpib: lpvo_usb: Return error value from gpib_register_driver() Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 14/15] staging: gpib: pc2: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 15/15] staging: gpib: tnt4882: " Nihar Chaithanya
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.
In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err() statements indicating the
fail and error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index b7b6fb1be379..b1b9598c3b33 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -2619,12 +2619,23 @@ static struct usb_driver ni_usb_bus_driver = {
static int __init ni_usb_init_module(void)
{
int i;
+ int ret;
pr_info("ni_usb_gpib driver loading\n");
for (i = 0; i < MAX_NUM_NI_USB_INTERFACES; i++)
ni_usb_driver_interfaces[i] = NULL;
- usb_register(&ni_usb_bus_driver);
- gpib_register_driver(&ni_usb_gpib_interface, THIS_MODULE);
+
+ ret = usb_register(&ni_usb_bus_driver);
+ if (ret) {
+ pr_err("ni_usb_gpib: usb_register failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&ni_usb_gpib_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("ni_usb_gpib: gpib_register_driver failed: error = %d\n", ret);
+ return ret;
+ }
return 0;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 14/15] staging: gpib: pc2: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (12 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 13/15] staging: gpib: ni_usb: Handle gpib_register_driver() errors Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 15/15] staging: gpib: tnt4882: " Nihar Chaithanya
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
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>
---
drivers/staging/gpib/pc2/pc2_gpib.c | 38 ++++++++++++++++++++++++++---
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c
index 7b3b34f47341..a9aae563f60a 100644
--- a/drivers/staging/gpib/pc2/pc2_gpib.c
+++ b/drivers/staging/gpib/pc2/pc2_gpib.c
@@ -635,12 +635,42 @@ void pc2_2a_detach(gpib_board_t *board)
static int __init pc2_init_module(void)
{
- gpib_register_driver(&pc2_interface, THIS_MODULE);
- gpib_register_driver(&pc2a_interface, THIS_MODULE);
- gpib_register_driver(&pc2a_cb7210_interface, THIS_MODULE);
- gpib_register_driver(&pc2_2a_interface, THIS_MODULE);
+ int ret;
+
+ ret = gpib_register_driver(&pc2_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
+ return ret;
+ }
+
+ ret = gpib_register_driver(&pc2a_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pc2a;
+ }
+
+ ret = gpib_register_driver(&pc2a_cb7210_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_cb7210;
+ }
+
+ ret = gpib_register_driver(&pc2_2a_interface, THIS_MODULE);
+ if (ret) {
+ pr_err("pc2_gpib: gpib_register_driver failed: error = %d\n", ret);
+ goto err_pc2_2a;
+ }
return 0;
+
+err_pc2_2a:
+ gpib_unregister_driver(&pc2a_cb7210_interface);
+err_cb7210:
+ gpib_unregister_driver(&pc2a_interface);
+err_pc2a:
+ gpib_unregister_driver(&pc2_interface);
+
+ return ret;
}
static void __exit pc2_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v6 15/15] staging: gpib: tnt4882: Handle gpib_register_driver() errors
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
` (13 preceding siblings ...)
2024-12-30 18:56 ` [PATCH v6 14/15] staging: gpib: pc2: " Nihar Chaithanya
@ 2024-12-30 18:56 ` Nihar Chaithanya
14 siblings, 0 replies; 17+ messages in thread
From: Nihar Chaithanya @ 2024-12-30 18:56 UTC (permalink / raw)
To: dpenkler, gregkh
Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
The error value from the init_ni_gpib_cs() function is not
returned and the previous registering functions are not unregistered.
The function gpib_register_driver() can fail and similar to
pcmcia_register_driver() function failing, the previous registering
functions are not unregistered.
Unregister the gpib and pci register functions if the subsequent
gpib or pcmcia register functions fail and return the error value. Add
pr_err() statements indicating the fail and the error value.
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
---
drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 106 +++++++++++++++++---
1 file changed, 93 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
index e49a952fa0d8..a2549231525b 100644
--- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
+++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c
@@ -1524,29 +1524,109 @@ static int __init tnt4882_init_module(void)
result = pci_register_driver(&tnt4882_pci_driver);
if (result) {
- pr_err("tnt4882: pci_driver_register failed!\n");
+ pr_err("tnt4882_gpib: pci_register_driver failed: error = %d\n", result);
return result;
}
- gpib_register_driver(&ni_isa_interface, THIS_MODULE);
- gpib_register_driver(&ni_isa_accel_interface, THIS_MODULE);
- gpib_register_driver(&ni_nat4882_isa_interface, THIS_MODULE);
- gpib_register_driver(&ni_nat4882_isa_accel_interface, THIS_MODULE);
- gpib_register_driver(&ni_nec_isa_interface, THIS_MODULE);
- gpib_register_driver(&ni_nec_isa_accel_interface, THIS_MODULE);
- gpib_register_driver(&ni_pci_interface, THIS_MODULE);
- gpib_register_driver(&ni_pci_accel_interface, THIS_MODULE);
+ result = gpib_register_driver(&ni_isa_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_isa;
+ }
+
+ result = gpib_register_driver(&ni_isa_accel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_isa_accel;
+ }
+
+ result = gpib_register_driver(&ni_nat4882_isa_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_nat4882_isa;
+ }
+
+ result = gpib_register_driver(&ni_nat4882_isa_accel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_nat4882_isa_accel;
+ }
+
+ result = gpib_register_driver(&ni_nec_isa_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_nec_isa;
+ }
+
+ result = gpib_register_driver(&ni_nec_isa_accel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_nec_isa_accel;
+ }
+
+ result = gpib_register_driver(&ni_pci_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_pci;
+ }
+
+ result = gpib_register_driver(&ni_pci_accel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_pci_accel;
+ }
+
#ifdef GPIB_PCMCIA
- gpib_register_driver(&ni_pcmcia_interface, THIS_MODULE);
- gpib_register_driver(&ni_pcmcia_accel_interface, THIS_MODULE);
- if (init_ni_gpib_cs() < 0)
- return -1;
+ result = gpib_register_driver(&ni_pcmcia_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_pcmcia;
+ }
+
+ result = gpib_register_driver(&ni_pcmcia_accel_interface, THIS_MODULE);
+ if (result) {
+ pr_err("tnt4882_gpib: gpib_register_driver failed: error = %d\n", result);
+ goto err_pcmcia_accel;
+ }
+
+ result = init_ni_gpib_cs();
+ if (result) {
+ pr_err("tnt4882_gpib: pcmcia_register_driver failed: error = %d\n", result);
+ goto err_pcmcia_driver;
+ }
#endif
mite_init();
mite_list_devices();
return 0;
+
+#ifdef GPIB_PCMCIA
+err_pcmcia_driver:
+ gpib_unregister_driver(&ni_pcmcia_accel_interface);
+err_pcmcia_accel:
+ gpib_unregister_driver(&ni_pcmcia_interface);
+err_pcmcia:
+#endif
+ gpib_unregister_driver(&ni_pci_accel_interface);
+err_pci_accel:
+ gpib_unregister_driver(&ni_pci_interface);
+err_pci:
+ gpib_unregister_driver(&ni_nec_isa_accel_interface);
+err_nec_isa_accel:
+ gpib_unregister_driver(&ni_nec_isa_interface);
+err_nec_isa:
+ gpib_unregister_driver(&ni_nat4882_isa_accel_interface);
+err_nat4882_isa_accel:
+ gpib_unregister_driver(&ni_nat4882_isa_interface);
+err_nat4882_isa:
+ gpib_unregister_driver(&ni_isa_accel_interface);
+err_isa_accel:
+ gpib_unregister_driver(&ni_isa_interface);
+err_isa:
+ pci_unregister_driver(&tnt4882_pci_driver);
+
+ return result;
}
static void __exit tnt4882_exit_module(void)
--
2.34.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v6 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
2024-12-30 18:56 ` [PATCH v6 07/15] staging: gpib: fmh: " Nihar Chaithanya
@ 2024-12-31 4:13 ` kernel test robot
0 siblings, 0 replies; 17+ messages in thread
From: kernel test robot @ 2024-12-31 4:13 UTC (permalink / raw)
To: Nihar Chaithanya, dpenkler, gregkh
Cc: oe-kbuild-all, dan.carpenter, skhan, linux-staging, linux-kernel,
Nihar Chaithanya
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/20241231-031406
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20241230185633.175690-8-niharchaithanya%40gmail.com
patch subject: [PATCH v6 07/15] staging: gpib: fmh: Handle gpib_register_driver() errors
config: xtensa-randconfig-001-20241231 (https://download.01.org/0day-ci/archive/20241231/202412311213.Dcj8Nucn-lkp@intel.com/config)
compiler: xtensa-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241231/202412311213.Dcj8Nucn-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/202412311213.Dcj8Nucn-lkp@intel.com/
All errors (new ones prefixed by >>):
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x38): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x40): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x48): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x50): undefined reference to `gpib_register_driver'
>> xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x58): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x5c): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.init.literal+0x60): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `lacs_or_read_ready':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:286:(.text+0x2c4): undefined reference to `nec7210_t1_delay'
xtensa-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+0x2de): undefined reference to `nec7210_t1_delay'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:271:(.text+0x318): undefined reference to `nec7210_serial_poll_status'
xtensa-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+0x328): undefined reference to `nec7210_secondary_address'
xtensa-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+0x33c): undefined reference to `nec7210_primary_address'
xtensa-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+0x34c): undefined reference to `nec7210_update_status'
xtensa-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+0x35c): undefined reference to `nec7210_parallel_poll_response'
xtensa-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+0x36c): undefined reference to `nec7210_parallel_poll'
xtensa-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+0x37c): undefined reference to `nec7210_parallel_poll_configure'
xtensa-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+0x390): undefined reference to `nec7210_disable_eos'
xtensa-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+0x3a0): undefined reference to `nec7210_enable_eos'
xtensa-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+0x3b4): undefined reference to `nec7210_remote_enable'
xtensa-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+0x3c4): undefined reference to `nec7210_interface_clear'
xtensa-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+0x3d4): undefined reference to `nec7210_request_system_control'
xtensa-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+0x3e4): undefined reference to `nec7210_go_to_standby'
xtensa-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+0x3f4): undefined reference to `nec7210_take_control'
xtensa-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+0x404): undefined reference to `nec7210_command'
xtensa-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+0x41c): undefined reference to `nec7210_write'
xtensa-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+0x434): undefined reference to `nec7210_read'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `wait_for_read':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:305:(.text+0x668): undefined reference to `gpib_match_device_path'
xtensa-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+0x68a): undefined reference to `gpib_match_device_path'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_return_to_local':
drivers/staging/gpib/include/nec7210.h:59:(.text+0x808): undefined reference to `nec7210_board_reset'
xtensa-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+0x86a): undefined reference to `nec7210_board_reset'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_attach_holdoff_end':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1493:(.text+0xc1c): undefined reference to `nec7210_board_reset'
xtensa-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+0xc7e): undefined reference to `nec7210_board_reset'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1649:(.text+0xd44): undefined reference to `gpib_pci_get_device'
xtensa-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+0xd9f): undefined reference to `gpib_pci_get_device'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_all_bytes_are_sent':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:387:(.text+0x1004): undefined reference to `push_gpib_event'
xtensa-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+0x107f): undefined reference to `push_gpib_event'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_all_bytes_are_sent':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:387:(.text+0x1008): undefined reference to `nec7210_interrupt_have_status'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_internal_interrupt':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1170:(.text+0x1096): undefined reference to `nec7210_interrupt_have_status'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_interrupt':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1251:(.text+0x1244): undefined reference to `nec7210_set_reg_bits'
xtensa-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+0x127b): undefined reference to `nec7210_set_reg_bits'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_callback':
include/linux/spinlock.h:406:(.text+0x1324): undefined reference to `nec7210_set_reg_bits'
xtensa-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+0x14e4): undefined reference to `nec7210_set_reg_bits'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_dma_callback':
include/linux/spinlock.h:406:(.text+0x1328): undefined reference to `nec7210_set_reg_bits'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:drivers/staging/gpib/fmh_gpib/fmh_gpib.c:762: more undefined references to `nec7210_set_reg_bits' follow
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init_module':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1704:(.init.text+0x4b): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1710:(.init.text+0x6b): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1716:(.init.text+0x8b): undefined reference to `gpib_register_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1722:(.init.text+0xab): undefined reference to `gpib_register_driver'
>> xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1731:(.init.text+0xc3): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1733:(.init.text+0xcc): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1735:(.init.text+0xd5): undefined reference to `gpib_unregister_driver'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.text.unlikely+0x0): undefined reference to `nec7210_board_reset'
xtensa-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.unlikely+0x3e): undefined reference to `nec7210_board_reset'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.text.unlikely+0x4): undefined reference to `nec7210_set_handshake_mode'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1344:(.text.unlikely+0x56): undefined reference to `nec7210_set_handshake_mode'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o:(.text.unlikely+0xc): undefined reference to `nec7210_board_online'
xtensa-linux-ld: drivers/staging/gpib/fmh_gpib/fmh_gpib.o: in function `fmh_gpib_init':
drivers/staging/gpib/fmh_gpib/fmh_gpib.c:1351:(.text.unlikely+0x87): undefined reference to `nec7210_board_online'
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2024-12-31 4:13 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30 18:56 [PATCH v6 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 02/15] staging: gpib: agilent_82350b: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 03/15] staging: gpib: agilent_82357a: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 04/15] staging: gpib: cb7210: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 05/15] staging: gpib: cec: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 06/15] staging: gpib: fluke: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 07/15] staging: gpib: fmh: " Nihar Chaithanya
2024-12-31 4:13 ` kernel test robot
2024-12-30 18:56 ` [PATCH v6 08/15] staging: gpib: gpio: Return error value from gpib_register_driver() Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 09/15] staging: gpib: hp_82335: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 10/15] staging: gpib: hp_82341: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 11/15] staging: gpib: ines: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 12/15] staging: gpib: lpvo_usb: Return error value from gpib_register_driver() Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 13/15] staging: gpib: ni_usb: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 14/15] staging: gpib: pc2: " Nihar Chaithanya
2024-12-30 18:56 ` [PATCH v6 15/15] staging: gpib: tnt4882: " Nihar Chaithanya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox