diff mbox

PCI: use dev_printk in quirk messages

Message ID 20090914203641.13356.85452.stgit@bob.kio
State Accepted, archived
Headers show

Commit Message

Bjorn Helgaas Sept. 14, 2009, 8:36 p.m. UTC
Convert quirk printks to dev_printk().

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Olaf Dabrunz <od@suse.de>
---
 drivers/pci/quirks.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jesse Barnes Sept. 14, 2009, 8:39 p.m. UTC | #1
On Mon, 14 Sep 2009 14:36:41 -0600
Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:

> Convert quirk printks to dev_printk().
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> CC: Olaf Dabrunz <od@suse.de>
> ---

Applied to linux-next, thanks.
Rolf Eike Beer Sept. 15, 2009, 5:44 a.m. UTC | #2
Bjorn Helgaas wrote:
> Convert quirk printks to dev_printk().
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> CC: Olaf Dabrunz <od@suse.de>
> ---
>  drivers/pci/quirks.c |   27 ++++++++++++---------------
>  1 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 85ce239..a77be7a 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -1569,10 +1569,8 @@ static void
>  quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) return;
> 
>  	dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT;
> -
> -	printk(KERN_INFO "PCI quirk: reroute interrupts for 0x%04x:0x%04x\n",
> -			dev->vendor, dev->device);
> -	return;
> +	dev_info(&dev->dev, "rerouting interrupts for [%04x:%04x]\n",
> +		 dev->vendor, dev->device);
>  }

I wonder if this [%04x:%04x] isn't redundant, this should be in the device 
name of pdev.dev?

Eike
Bjorn Helgaas Sept. 15, 2009, 2:56 p.m. UTC | #3
On Monday 14 September 2009 11:44:39 pm Rolf Eike Beer wrote:
> Bjorn Helgaas wrote:
> > Convert quirk printks to dev_printk().
> > 
> > Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> > CC: Olaf Dabrunz <od@suse.de>
> > ---
> >  drivers/pci/quirks.c |   27 ++++++++++++---------------
> >  1 files changed, 12 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> > index 85ce239..a77be7a 100644
> > --- a/drivers/pci/quirks.c
> > +++ b/drivers/pci/quirks.c
> > @@ -1569,10 +1569,8 @@ static void
> >  quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) return;
> > 
> >  	dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT;
> > -
> > -	printk(KERN_INFO "PCI quirk: reroute interrupts for 0x%04x:0x%04x\n",
> > -			dev->vendor, dev->device);
> > -	return;
> > +	dev_info(&dev->dev, "rerouting interrupts for [%04x:%04x]\n",
> > +		 dev->vendor, dev->device);
> >  }
> 
> I wonder if this [%04x:%04x] isn't redundant, this should be in the device 
> name of pdev.dev?

I did contemplate removing that, because you can always get it
with "lspci -nn", but I left it in the interest of being less
controversial (look what it got me :-)).

But the new printk will look like:

  pci 0000:40:10.0: rerouting interrupts for [1022:7450]

The vendor/device ID doesn't appear in the pdev.dev name, so
it's actually not completely redundant.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rolf Eike Beer Sept. 15, 2009, 5:09 p.m. UTC | #4
Bjorn Helgaas wrote:
> On Monday 14 September 2009 11:44:39 pm Rolf Eike Beer wrote:
> > Bjorn Helgaas wrote:
> > > Convert quirk printks to dev_printk().
> > >
> > > Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> > > CC: Olaf Dabrunz <od@suse.de>
> > > ---
> > >  drivers/pci/quirks.c |   27 ++++++++++++---------------
> > >  1 files changed, 12 insertions(+), 15 deletions(-)
> > >
> > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> > > index 85ce239..a77be7a 100644
> > > --- a/drivers/pci/quirks.c
> > > +++ b/drivers/pci/quirks.c
> > > @@ -1569,10 +1569,8 @@ static void
> > >  quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) return;
> > >
> > >  	dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT;
> > > -
> > > -	printk(KERN_INFO "PCI quirk: reroute interrupts for 0x%04x:0x%04x\n",
> > > -			dev->vendor, dev->device);
> > > -	return;
> > > +	dev_info(&dev->dev, "rerouting interrupts for [%04x:%04x]\n",
> > > +		 dev->vendor, dev->device);
> > >  }
> >
> > I wonder if this [%04x:%04x] isn't redundant, this should be in the
> > device name of pdev.dev?
> 
> I did contemplate removing that, because you can always get it
> with "lspci -nn", but I left it in the interest of being less
> controversial (look what it got me :-)).
> 
> But the new printk will look like:
> 
>   pci 0000:40:10.0: rerouting interrupts for [1022:7450]
> 
> The vendor/device ID doesn't appear in the pdev.dev name, so
> it's actually not completely redundant.

Ah, sorry, I thought it was the bus/function number. So it's in fact different 
information.

Eike
diff mbox

Patch

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 85ce239..a77be7a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1569,10 +1569,8 @@  static void quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev)
 		return;
 
 	dev->irq_reroute_variant = INTEL_IRQ_REROUTE_VARIANT;
-
-	printk(KERN_INFO "PCI quirk: reroute interrupts for 0x%04x:0x%04x\n",
-			dev->vendor, dev->device);
-	return;
+	dev_info(&dev->dev, "rerouting interrupts for [%04x:%04x]\n",
+		 dev->vendor, dev->device);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_80333_0,	quirk_reroute_to_boot_interrupts_intel);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_80333_1,	quirk_reroute_to_boot_interrupts_intel);
@@ -1614,8 +1612,8 @@  static void quirk_disable_intel_boot_interrupt(struct pci_dev *dev)
 	pci_config_word |= INTEL_6300_DISABLE_BOOT_IRQ;
 	pci_write_config_word(dev, INTEL_6300_IOAPIC_ABAR, pci_config_word);
 
-	printk(KERN_INFO "disabled boot interrupt on device 0x%04x:0x%04x\n",
-		dev->vendor, dev->device);
+	dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n",
+		 dev->vendor, dev->device);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ESB_10, 	quirk_disable_intel_boot_interrupt);
 DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ESB_10, 	quirk_disable_intel_boot_interrupt);
@@ -1647,8 +1645,8 @@  static void quirk_disable_broadcom_boot_interrupt(struct pci_dev *dev)
 
 	pci_write_config_dword(dev, BC_HT1000_FEATURE_REG, pci_config_dword);
 
-	printk(KERN_INFO "disabled boot interrupts on PCI device"
-			"0x%04x:0x%04x\n", dev->vendor, dev->device);
+	dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n",
+		 dev->vendor, dev->device);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS,   PCI_DEVICE_ID_SERVERWORKS_HT1000SB, 	quirk_disable_broadcom_boot_interrupt);
 DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SERVERWORKS,   PCI_DEVICE_ID_SERVERWORKS_HT1000SB, 	quirk_disable_broadcom_boot_interrupt);
@@ -1678,8 +1676,8 @@  static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev)
 	pci_config_dword &= ~AMD_813X_NOIOAMODE;
 	pci_write_config_dword(dev, AMD_813X_MISC, pci_config_dword);
 
-	printk(KERN_INFO "disabled boot interrupts on PCI device "
-			"0x%04x:0x%04x\n", dev->vendor, dev->device);
+	dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n",
+		 dev->vendor, dev->device);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8131_BRIDGE, 	quirk_disable_amd_813x_boot_interrupt);
 DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8132_BRIDGE, 	quirk_disable_amd_813x_boot_interrupt);
@@ -1695,14 +1693,13 @@  static void quirk_disable_amd_8111_boot_interrupt(struct pci_dev *dev)
 
 	pci_read_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, &pci_config_word);
 	if (!pci_config_word) {
-		printk(KERN_INFO "boot interrupts on PCI device 0x%04x:0x%04x "
-				"already disabled\n",
-				dev->vendor, dev->device);
+		dev_info(&dev->dev, "boot interrupts on device [%04x:%04x] "
+			 "already disabled\n", dev->vendor, dev->device);
 		return;
 	}
 	pci_write_config_word(dev, AMD_8111_PCI_IRQ_ROUTING, 0);
-	printk(KERN_INFO "disabled boot interrupts on PCI device "
-			"0x%04x:0x%04x\n", dev->vendor, dev->device);
+	dev_info(&dev->dev, "disabled boot interrupts on device [%04x:%04x]\n",
+		 dev->vendor, dev->device);
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8111_SMBUS, 	quirk_disable_amd_8111_boot_interrupt);
 DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_AMD,   PCI_DEVICE_ID_AMD_8111_SMBUS, 	quirk_disable_amd_8111_boot_interrupt);