]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: gpib: hp82335 console messaging cleanup
authorDave Penkler <dpenkler@gmail.com>
Fri, 14 Feb 2025 11:47:00 +0000 (12:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2025 15:47:57 +0000 (16:47 +0100)
Enable module name to be printed in pr_xxx and dev_xxx
Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded
string "hp82335" in request_irq

Change pr_err to dev_err wherever possible

Remove pr_info's

Remove "hp83335:" prefix in messages since this is
printed with the module name.

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250214114708.28947-10-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/hp_82335/hp82335.c

index 451d5dc6d3405ddf879b855d7e30bccb425d62ee..982544d1b382cc3bb2a38dc91cbc493eb85d5580 100644 (file)
@@ -8,6 +8,10 @@
  *     implement recovery from bus errors (if necessary)
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#define dev_fmt pr_fmt
+#define DRV_NAME KBUILD_MODNAME
+
 #include "hp82335.h"
 #include <linux/io.h>
 #include <linux/ioport.h>
@@ -274,26 +278,23 @@ static int hp82335_attach(gpib_board_t *board, const gpib_board_config_t *config
        case 0xfc000:
                break;
        default:
-               pr_err("hp82335: invalid base io address 0x%u\n", config->ibbase);
+               dev_err(board->gpib_dev, "invalid base io address 0x%x\n", config->ibbase);
                return -EINVAL;
        }
        if (!request_mem_region(upper_iomem_base, hp82335_upper_iomem_size, "hp82335")) {
-               pr_err("hp82335: failed to allocate io memory region 0x%lx-0x%lx\n",
-                      upper_iomem_base, upper_iomem_base + hp82335_upper_iomem_size - 1);
+               dev_err(board->gpib_dev, "failed to allocate io memory region 0x%lx-0x%lx\n",
+                       upper_iomem_base, upper_iomem_base + hp82335_upper_iomem_size - 1);
                return -EBUSY;
        }
        hp_priv->raw_iobase = upper_iomem_base;
        tms_priv->mmiobase = ioremap(upper_iomem_base, hp82335_upper_iomem_size);
-       pr_info("hp82335: upper half of 82335 iomem region 0x%lx remapped to 0x%p\n",
-               hp_priv->raw_iobase, tms_priv->mmiobase);
 
-       retval = request_irq(config->ibirq, hp82335_interrupt, 0, "hp82335", board);
+       retval = request_irq(config->ibirq, hp82335_interrupt, 0, DRV_NAME, board);
        if (retval) {
-               pr_err("hp82335: can't request IRQ %d\n", config->ibirq);
+               dev_err(board->gpib_dev, "can't request IRQ %d\n", config->ibirq);
                return retval;
        }
        hp_priv->irq = config->ibirq;
-       pr_info("hp82335: IRQ %d\n", config->ibirq);
 
        tms9914_board_reset(tms_priv);
 
@@ -331,7 +332,7 @@ static int __init hp82335_init_module(void)
        int result = gpib_register_driver(&hp82335_interface, THIS_MODULE);
 
        if (result) {
-               pr_err("hp82335: gpib_register_driver failed: error = %d\n", result);
+               pr_err("gpib_register_driver failed: error = %d\n", result);
                return result;
        }