aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat_dca.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2007-10-18 06:07:13 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:32 -0400
commit5149fd010f404889b7d8f79159057791fbb817b1 (patch)
tree0ec09c009f35d59be64e3b952b6deba39b61f6e1 /drivers/dma/ioat_dca.c
parentdfe2299e7b35a0adfc87f04d3e725ccc508d7626 (diff)
I/OAT: clean up error handling and some print messages
Make better use of dev_err(), and catch an error where the transaction creation might fail. Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/dma/ioat_dca.c')
-rw-r--r--drivers/dma/ioat_dca.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/dma/ioat_dca.c b/drivers/dma/ioat_dca.c
index 2ae04c30ede..ba985715b80 100644
--- a/drivers/dma/ioat_dca.c
+++ b/drivers/dma/ioat_dca.c
@@ -65,7 +65,7 @@ static inline u16 dcaid_from_pcidev(struct pci_dev *pci)
65 return (pci->bus->number << 8) | pci->devfn; 65 return (pci->bus->number << 8) | pci->devfn;
66} 66}
67 67
68static int dca_enabled_in_bios(void) 68static int dca_enabled_in_bios(struct pci_dev *pdev)
69{ 69{
70 /* CPUID level 9 returns DCA configuration */ 70 /* CPUID level 9 returns DCA configuration */
71 /* Bit 0 indicates DCA enabled by the BIOS */ 71 /* Bit 0 indicates DCA enabled by the BIOS */
@@ -75,17 +75,17 @@ static int dca_enabled_in_bios(void)
75 cpuid_level_9 = cpuid_eax(9); 75 cpuid_level_9 = cpuid_eax(9);
76 res = test_bit(0, &cpuid_level_9); 76 res = test_bit(0, &cpuid_level_9);
77 if (!res) 77 if (!res)
78 printk(KERN_ERR "ioat dma: DCA is disabled in BIOS\n"); 78 dev_err(&pdev->dev, "DCA is disabled in BIOS\n");
79 79
80 return res; 80 return res;
81} 81}
82 82
83static int system_has_dca_enabled(void) 83static int system_has_dca_enabled(struct pci_dev *pdev)
84{ 84{
85 if (boot_cpu_has(X86_FEATURE_DCA)) 85 if (boot_cpu_has(X86_FEATURE_DCA))
86 return dca_enabled_in_bios(); 86 return dca_enabled_in_bios(pdev);
87 87
88 printk(KERN_ERR "ioat dma: boot cpu doesn't have X86_FEATURE_DCA\n"); 88 dev_err(&pdev->dev, "boot cpu doesn't have X86_FEATURE_DCA\n");
89 return 0; 89 return 0;
90} 90}
91 91
@@ -208,7 +208,7 @@ struct dca_provider *ioat_dca_init(struct pci_dev *pdev, void __iomem *iobase)
208 int i; 208 int i;
209 int err; 209 int err;
210 210
211 if (!system_has_dca_enabled()) 211 if (!system_has_dca_enabled(pdev))
212 return NULL; 212 return NULL;
213 213
214 /* I/OAT v1 systems must have a known tag_map to support DCA */ 214 /* I/OAT v1 systems must have a known tag_map to support DCA */