Message ID | 20211208163255.114660-69-hare@suse.de |
---|---|
State | New |
Headers | show |
Series | libata: rework logging, take II | expand |
On 2021/12/09 1:32, Hannes Reinecke wrote: > Convert pr_XXX() calls to structured logging. > > Signed-off-by: Hannes Reinecke <hare@suse.de> > --- > drivers/ata/pata_hpt37x.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c > index f242157bc81b..47709eb9d135 100644 > --- a/drivers/ata/pata_hpt37x.c > +++ b/drivers/ata/pata_hpt37x.c > @@ -15,8 +15,6 @@ > * Look into engine reset on timeout errors. Should not be required. > */ > > -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt I think you can also remove the blank line before this line too. > - > #include <linux/kernel.h> > #include <linux/module.h> > #include <linux/pci.h> > @@ -231,7 +229,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 +863,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 +905,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 +954,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 +1010,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 +1018,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 +1033,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]); > } > >
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index f242157bc81b..47709eb9d135 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c @@ -15,8 +15,6 @@ * 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 +229,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 +863,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 +905,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 +954,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 +1010,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 +1018,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 +1033,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]); }
Convert pr_XXX() calls to structured logging. Signed-off-by: Hannes Reinecke <hare@suse.de> --- drivers/ata/pata_hpt37x.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)