ata: pata_hpt37x: convert pr_XXX() calls
authorHannes Reinecke <hare@suse.de>
Tue, 21 Dec 2021 07:21:23 +0000 (08:21 +0100)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 5 Jan 2022 10:33:03 +0000 (19:33 +0900)
Convert pr_XXX() calls to structured logging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/pata_hpt37x.c

index f242157..7abc7e0 100644 (file)
@@ -14,9 +14,6 @@
  * TODO
  *     Look into engine reset on timeout errors. Should not be required.
  */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -231,7 +228,8 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr,
 
        i = match_string(list, -1, model_num);
        if (i >= 0) {
-               pr_warn("%s is not supported for %s\n", modestr, list[i]);
+               ata_dev_warn(dev, "%s is not supported for %s\n",
+                            modestr, list[i]);
                return 1;
        }
        return 0;
@@ -864,7 +862,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        chip_table = &hpt372;
                        break;
                default:
-                       pr_err("Unknown HPT366 subtype, please report (%d)\n",
+                       dev_err(&dev->dev,
+                               "Unknown HPT366 subtype, please report (%d)\n",
                               rev);
                        return -ENODEV;
                }
@@ -905,7 +904,8 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                        *ppi = &info_hpt374_fn1;
                break;
        default:
-               pr_err("PCI table is bogus, please report (%d)\n", dev->device);
+               dev_err(&dev->dev, "PCI table is bogus, please report (%d)\n",
+                       dev->device);
                return -ENODEV;
        }
        /* Ok so this is a chip we support */
@@ -953,7 +953,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                u8 sr;
                u32 total = 0;
 
-               pr_warn("BIOS has not set timing clocks\n");
+               dev_warn(&dev->dev, "BIOS has not set timing clocks\n");
 
                /* This is the process the HPT371 BIOS is reported to use */
                for (i = 0; i < 128; i++) {
@@ -1009,7 +1009,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                                               (f_high << 16) | f_low | 0x100);
                }
                if (adjust == 8) {
-                       pr_err("DPLL did not stabilize!\n");
+                       dev_err(&dev->dev, "DPLL did not stabilize!\n");
                        return -ENODEV;
                }
                if (dpll == 3)
@@ -1017,7 +1017,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                else
                        private_data = (void *)hpt37x_timings_50;
 
-               pr_info("bus clock %dMHz, using %dMHz DPLL\n",
+               dev_info(&dev->dev, "bus clock %dMHz, using %dMHz DPLL\n",
                        MHz[clock_slot], MHz[dpll]);
        } else {
                private_data = (void *)chip_table->clocks[clock_slot];
@@ -1032,7 +1032,7 @@ static int hpt37x_init_one(struct pci_dev *dev, const struct pci_device_id *id)
                if (clock_slot < 2 && ppi[0] == &info_hpt370a)
                        ppi[0] = &info_hpt370a_33;
 
-               pr_info("%s using %dMHz bus clock\n",
+               dev_info(&dev->dev, "%s using %dMHz bus clock\n",
                        chip_table->name, MHz[clock_slot]);
        }