]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: shpchp: Remove 'shpchp_debug' module parameter
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 17 Feb 2025 09:55:50 +0000 (11:55 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 19 Feb 2025 22:54:42 +0000 (16:54 -0600)
The "shpchp_debug" module parameter is used to enable debug logging.  The
generic ability to turn on/off debug prints dynamically covers this use
case already so there is no need for module specific debug handling.  The
ctrl_dbg() wrapper also uses a low-level pci_printk() despite always using
KERN_DEBUG level.

Remove "shpchp_debug" parameter and convert ctrl_dbg() to use pci_dbg().

From now on, shpchp can be debugged using the normal dynamic debugger by
setting CONFIG_DYNAMIC_DEBUG=y and then either adding to kernel cmdline:

  dyndbg="file drivers/pci/hotplug/shpchp* +p"

or using this command on a running kernel:

  echo 'file drivers/pci/hotplug/shpchp* +p' > /sys/kernel/debug/dynamic_debug/control

Link: https://lore.kernel.org/r/20250217095550.2789-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/shpchp.h
drivers/pci/hotplug/shpchp_core.c

index 10ba0bfac4191c8f29d1dfc382a5ffa466ecfbe9..a425530e093930034619f05c0c3fd8d6732addc9 100644 (file)
@@ -34,11 +34,7 @@ extern int shpchp_poll_time;
 extern bool shpchp_debug;
 
 #define ctrl_dbg(ctrl, format, arg...)                                 \
-       do {                                                            \
-               if (shpchp_debug)                                       \
-                       pci_printk(KERN_DEBUG, ctrl->pci_dev,           \
-                                       format, ## arg);                \
-       } while (0)
+       pci_dbg(ctrl->pci_dev, format, ## arg)
 #define ctrl_err(ctrl, format, arg...)                                 \
        pci_err(ctrl->pci_dev, format, ## arg)
 #define ctrl_info(ctrl, format, arg...)                                        \
index a10ce7be7f5117904b1802a22f84b812e220b3e3..0c341453afc60574b015615c36d4101280123e1b 100644 (file)
@@ -22,7 +22,6 @@
 #include "shpchp.h"
 
 /* Global variables */
-bool shpchp_debug;
 bool shpchp_poll_mode;
 int shpchp_poll_time;
 
@@ -33,10 +32,8 @@ int shpchp_poll_time;
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 
-module_param(shpchp_debug, bool, 0644);
 module_param(shpchp_poll_mode, bool, 0644);
 module_param(shpchp_poll_time, int, 0644);
-MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
 MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
 MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");