]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: gpib: comment out pnp_device_id tables
authorArnd Bergmann <arnd@arndb.de>
Mon, 17 Feb 2025 13:13:36 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2025 15:49:11 +0000 (16:49 +0100)
This variable is not referenced in either of these two drivers driver,
causing a warning when they are built-in and W=1 warnings are enabled
with gcc:

drivers/staging/gpib/tnt4882/tnt4882_gpib.c:1507:35: error: 'tnt4882_pnp_table' defined but not used [-Werror=unused-const-variable=]
 1507 | static const struct pnp_device_id tnt4882_pnp_table[] = {
      |                                   ^~~~~~~~~~~~~~~~~
drivers/staging/gpib/hp_82341/hp_82341.c:811:35: error: 'hp_82341_pnp_table' defined but not used [-Werror=unused-const-variable=]
  811 | static const struct pnp_device_id hp_82341_pnp_table[] = {

The MODULE_DEVICE_TABLE() entry does have the effect of loading
the module when the PNP device is detected, so it is still needed
for the modular case.

Ideally the drivers should be converted to pnp_register_driver(),
which would lead to the ID table actually being used.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250217131356.3759347-2-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/hp_82341/hp_82341.c
drivers/staging/gpib/tnt4882/tnt4882_gpib.c

index 3ac87d1a1fab8e83a4d7e5a49e7463a8e576e774..b93a830be8a94cbdd7d386ebeb42565c130a4ca5 100644 (file)
@@ -802,11 +802,14 @@ static void hp_82341_detach(gpib_board_t *board)
        hp_82341_free_private(board);
 }
 
+#if 0
+/* unused, will be needed when the driver is turned into a pnp_driver */
 static const struct pnp_device_id hp_82341_pnp_table[] = {
        {.id = "HWP1411"},
        {.id = ""}
 };
 MODULE_DEVICE_TABLE(pnp, hp_82341_pnp_table);
+#endif
 
 static int __init hp_82341_init_module(void)
 {
index 2e1c3cbebaca578b5ff0b31f7bace642e8a17814..df92e9959fe1d20a3e94f4f43c79f0b7a864d64a 100644 (file)
@@ -1390,11 +1390,14 @@ static struct pci_driver tnt4882_pci_driver = {
        .probe = &tnt4882_pci_probe
 };
 
+#if 0
+/* unused, will be needed when the driver is turned into a pnp_driver */
 static const struct pnp_device_id tnt4882_pnp_table[] = {
        {.id = "NICC601"},
        {.id = ""}
 };
 MODULE_DEVICE_TABLE(pnp, tnt4882_pnp_table);
+#endif
 
 #ifdef GPIB_PCMCIA
 static gpib_interface_t ni_pcmcia_interface;