提交 a9524a76 编写于 作者: J Jeff Garzik

[libata] use dev_printk() throughout drivers

A few drivers were not following the standard meme of printing out
their driver name and version at module load time; this is fixed
as well.
上级 fbf30fba
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -674,10 +675,10 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * ...@@ -674,10 +675,10 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
if (!ahci_host_intr(ap, qc)) if (!ahci_host_intr(ap, qc))
if (ata_ratelimit()) { if (ata_ratelimit()) {
struct pci_dev *pdev = struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev); to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING dev_printk(KERN_WARNING, &pdev->dev,
"ahci(%s): unhandled interrupt on port %u\n", "unhandled interrupt on port %u\n",
pci_name(pdev), i); i);
} }
VPRINTK("port %u\n", i); VPRINTK("port %u\n", i);
...@@ -685,10 +686,9 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * ...@@ -685,10 +686,9 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
VPRINTK("port %u (no irq)\n", i); VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) { if (ata_ratelimit()) {
struct pci_dev *pdev = struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev); to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING dev_printk(KERN_WARNING, &pdev->dev,
"ahci(%s): interrupt on disabled port %u\n", "interrupt on disabled port %u\n", i);
pci_name(pdev), i);
} }
} }
...@@ -760,8 +760,8 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent) ...@@ -760,8 +760,8 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
tmp = readl(mmio + HOST_CTL); tmp = readl(mmio + HOST_CTL);
if (tmp & HOST_RESET) { if (tmp & HOST_RESET) {
printk(KERN_ERR DRV_NAME "(%s): controller reset failed (0x%x)\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev), tmp); "controller reset failed (0x%x)\n", tmp);
return -EIO; return -EIO;
} }
...@@ -789,22 +789,22 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent) ...@@ -789,22 +789,22 @@ static int ahci_host_init(struct ata_probe_ent *probe_ent)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 64-bit DMA enable failed\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev)); "64-bit DMA enable failed\n");
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev)); "32-bit DMA enable failed\n");
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit consistent DMA enable failed\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev)); "32-bit consistent DMA enable failed\n");
return rc; return rc;
} }
} }
...@@ -907,10 +907,10 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent) ...@@ -907,10 +907,10 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
else else
scc_s = "unknown"; scc_s = "unknown";
printk(KERN_INFO DRV_NAME "(%s) AHCI %02x%02x.%02x%02x " dev_printk(KERN_INFO, &pdev->dev,
"AHCI %02x%02x.%02x%02x "
"%u slots %u ports %s Gbps 0x%x impl %s mode\n" "%u slots %u ports %s Gbps 0x%x impl %s mode\n"
, ,
pci_name(pdev),
(vers >> 24) & 0xff, (vers >> 24) & 0xff,
(vers >> 16) & 0xff, (vers >> 16) & 0xff,
...@@ -923,11 +923,11 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent) ...@@ -923,11 +923,11 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
impl, impl,
scc_s); scc_s);
printk(KERN_INFO DRV_NAME "(%s) flags: " dev_printk(KERN_INFO, &pdev->dev,
"flags: "
"%s%s%s%s%s%s" "%s%s%s%s%s%s"
"%s%s%s%s%s%s%s\n" "%s%s%s%s%s%s%s\n"
, ,
pci_name(pdev),
cap & (1 << 31) ? "64bit " : "", cap & (1 << 31) ? "64bit " : "",
cap & (1 << 30) ? "ncq " : "", cap & (1 << 30) ? "ncq " : "",
...@@ -960,7 +960,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -960,7 +960,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
VPRINTK("ENTER\n"); VPRINTK("ENTER\n");
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -626,16 +627,14 @@ static int adma_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base) ...@@ -626,16 +627,14 @@ static int adma_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): 32-bit DMA enable failed\n", "32-bit DMA enable failed\n");
pci_name(pdev));
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): 32-bit consistent DMA enable failed\n", "32-bit consistent DMA enable failed\n");
pci_name(pdev));
return rc; return rc;
} }
return 0; return 0;
...@@ -651,7 +650,7 @@ static int adma_ata_init_one(struct pci_dev *pdev, ...@@ -651,7 +650,7 @@ static int adma_ata_init_one(struct pci_dev *pdev,
int rc, port_no; int rc, port_no;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -1437,9 +1438,9 @@ static void mv_print_info(struct ata_probe_ent *probe_ent) ...@@ -1437,9 +1438,9 @@ static void mv_print_info(struct ata_probe_ent *probe_ent)
else else
scc_s = "unknown"; scc_s = "unknown";
printk(KERN_INFO DRV_NAME dev_printk(KERN_INFO, &pdev->dev,
"(%s) %u slots %u ports %s mode IRQ via %s\n", "%u slots %u ports %s mode IRQ via %s\n",
pci_name(pdev), (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports, (unsigned)MV_MAX_Q_DEPTH, probe_ent->n_ports,
scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
} }
...@@ -1460,9 +1461,8 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1460,9 +1461,8 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
void __iomem *mmio_base; void __iomem *mmio_base;
int pci_dev_busy = 0, rc; int pci_dev_busy = 0, rc;
if (!printed_version++) { if (!printed_version++)
printk(KERN_INFO DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
}
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) { if (rc) {
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -383,7 +384,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -383,7 +384,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV; return -ENODEV;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -633,7 +634,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -633,7 +634,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
int rc; int rc;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* /*
* If this driver happens to only be useful on Apple's K2, then * If this driver happens to only be useful on Apple's K2, then
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -600,25 +601,22 @@ static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base) ...@@ -600,25 +601,22 @@ static int qs_set_dma_masks(struct pci_dev *pdev, void __iomem *mmio_base)
if (rc) { if (rc) {
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): 64-bit DMA enable failed\n", "64-bit DMA enable failed\n");
pci_name(pdev));
return rc; return rc;
} }
} }
} else { } else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): 32-bit DMA enable failed\n", "32-bit DMA enable failed\n");
pci_name(pdev));
return rc; return rc;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): 32-bit consistent DMA enable failed\n", "32-bit consistent DMA enable failed\n");
pci_name(pdev));
return rc; return rc;
} }
} }
...@@ -635,7 +633,7 @@ static int qs_ata_init_one(struct pci_dev *pdev, ...@@ -635,7 +633,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
int rc, port_no; int rc, port_no;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -386,7 +387,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -386,7 +387,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
u8 cls; u8 cls;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* /*
* If this driver happens to only be useful on Apple's K2, then * If this driver happens to only be useful on Apple's K2, then
...@@ -463,8 +464,8 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -463,8 +464,8 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
writeb(cls, mmio_base + SIL_FIFO_W3); writeb(cls, mmio_base + SIL_FIFO_W3);
} }
} else } else
printk(KERN_WARNING DRV_NAME "(%s): cache line size not set. Driver may not function\n", dev_printk(KERN_WARNING, &pdev->dev,
pci_name(pdev)); "cache line size not set. Driver may not function\n");
if (ent->driver_data == sil_3114) { if (ent->driver_data == sil_3114) {
irq_mask = SIL_MASK_4PORT; irq_mask = SIL_MASK_4PORT;
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/device.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include "scsi.h" #include "scsi.h"
#include <linux/libata.h> #include <linux/libata.h>
...@@ -690,7 +691,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -690,7 +691,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
int i, rc; int i, rc;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
...@@ -750,14 +751,14 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -750,14 +751,14 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/ */
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit DMA enable failed\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev)); "32-bit DMA enable failed\n");
goto out_free; goto out_free;
} }
rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (rc) { if (rc) {
printk(KERN_ERR DRV_NAME "(%s): 32-bit consistent DMA enable failed\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev)); "32-bit consistent DMA enable failed\n");
goto out_free; goto out_free;
} }
...@@ -793,9 +794,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -793,9 +794,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
break; break;
} }
if (tmp & PORT_CS_PORT_RST) if (tmp & PORT_CS_PORT_RST)
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): failed to clear port RST\n", "failed to clear port RST\n");
pci_name(pdev));
} }
/* Zero error counters. */ /* Zero error counters. */
...@@ -824,9 +824,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -824,9 +824,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* Reset itself */ /* Reset itself */
if (__sil24_reset_controller(port)) if (__sil24_reset_controller(port))
printk(KERN_ERR DRV_NAME dev_printk(KERN_ERR, &pdev->dev,
"(%s): failed to reset controller\n", "failed to reset controller\n");
pci_name(pdev));
} }
/* Turn on interrupts */ /* Turn on interrupts */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -237,6 +238,7 @@ static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) ...@@ -237,6 +238,7 @@ static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
struct ata_probe_ent *probe_ent = NULL; struct ata_probe_ent *probe_ent = NULL;
int rc; int rc;
u32 genctl; u32 genctl;
...@@ -245,6 +247,9 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -245,6 +247,9 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
u8 pmr; u8 pmr;
u8 port2_start; u8 port2_start;
if (!printed_version++)
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
return rc; return rc;
...@@ -288,16 +293,18 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -288,16 +293,18 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
pci_read_config_byte(pdev, SIS_PMR, &pmr); pci_read_config_byte(pdev, SIS_PMR, &pmr);
if (ent->device != 0x182) { if (ent->device != 0x182) {
if ((pmr & SIS_PMR_COMBINED) == 0) { if ((pmr & SIS_PMR_COMBINED) == 0) {
printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in SATA mode\n"); dev_printk(KERN_INFO, &pdev->dev,
"Detected SiS 180/181 chipset in SATA mode\n");
port2_start = 64; port2_start = 64;
} }
else { else {
printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in combined mode\n"); dev_printk(KERN_INFO, &pdev->dev,
"Detected SiS 180/181 chipset in combined mode\n");
port2_start=0; port2_start=0;
} }
} }
else { else {
printk(KERN_INFO "sata_sis: Detected SiS 182 chipset\n"); dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182 chipset\n");
port2_start = 0x20; port2_start = 0x20;
} }
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -362,7 +363,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e ...@@ -362,7 +363,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
int i; int i;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* /*
* If this driver happens to only be useful on Apple's K2, then * If this driver happens to only be useful on Apple's K2, then
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -1385,7 +1386,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id * ...@@ -1385,7 +1386,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
int rc; int rc;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
/* /*
* If this driver happens to only be useful on Apple's K2, then * If this driver happens to only be useful on Apple's K2, then
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -178,12 +179,16 @@ static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) ...@@ -178,12 +179,16 @@ static void uli_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
static int printed_version;
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
struct ata_port_info *ppi; struct ata_port_info *ppi;
int rc; int rc;
unsigned int board_idx = (unsigned int) ent->driver_data; unsigned int board_idx = (unsigned int) ent->driver_data;
int pci_dev_busy = 0; int pci_dev_busy = 0;
if (!printed_version++)
dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
return rc; return rc;
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -259,15 +260,15 @@ static void svia_configure(struct pci_dev *pdev) ...@@ -259,15 +260,15 @@ static void svia_configure(struct pci_dev *pdev)
u8 tmp8; u8 tmp8;
pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8); pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &tmp8);
printk(KERN_INFO DRV_NAME "(%s): routed to hard irq line %d\n", dev_printk(KERN_INFO, &pdev->dev, "routed to hard irq line %d\n",
pci_name(pdev),
(int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f); (int) (tmp8 & 0xf0) == 0xf0 ? 0 : tmp8 & 0x0f);
/* make sure SATA channels are enabled */ /* make sure SATA channels are enabled */
pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8); pci_read_config_byte(pdev, SATA_CHAN_ENAB, &tmp8);
if ((tmp8 & ALL_PORTS) != ALL_PORTS) { if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channels (0x%x)\n", dev_printk(KERN_DEBUG, &pdev->dev,
pci_name(pdev), (int) tmp8); "enabling SATA channels (0x%x)\n",
(int) tmp8);
tmp8 |= ALL_PORTS; tmp8 |= ALL_PORTS;
pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8); pci_write_config_byte(pdev, SATA_CHAN_ENAB, tmp8);
} }
...@@ -275,8 +276,9 @@ static void svia_configure(struct pci_dev *pdev) ...@@ -275,8 +276,9 @@ static void svia_configure(struct pci_dev *pdev)
/* make sure interrupts for each channel sent to us */ /* make sure interrupts for each channel sent to us */
pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8); pci_read_config_byte(pdev, SATA_INT_GATE, &tmp8);
if ((tmp8 & ALL_PORTS) != ALL_PORTS) { if ((tmp8 & ALL_PORTS) != ALL_PORTS) {
printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel interrupts (0x%x)\n", dev_printk(KERN_DEBUG, &pdev->dev,
pci_name(pdev), (int) tmp8); "enabling SATA channel interrupts (0x%x)\n",
(int) tmp8);
tmp8 |= ALL_PORTS; tmp8 |= ALL_PORTS;
pci_write_config_byte(pdev, SATA_INT_GATE, tmp8); pci_write_config_byte(pdev, SATA_INT_GATE, tmp8);
} }
...@@ -284,8 +286,9 @@ static void svia_configure(struct pci_dev *pdev) ...@@ -284,8 +286,9 @@ static void svia_configure(struct pci_dev *pdev)
/* make sure native mode is enabled */ /* make sure native mode is enabled */
pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8); pci_read_config_byte(pdev, SATA_NATIVE_MODE, &tmp8);
if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) { if ((tmp8 & NATIVE_MODE_ALL) != NATIVE_MODE_ALL) {
printk(KERN_DEBUG DRV_NAME "(%s): enabling SATA channel native mode (0x%x)\n", dev_printk(KERN_DEBUG, &pdev->dev,
pci_name(pdev), (int) tmp8); "enabling SATA channel native mode (0x%x)\n",
(int) tmp8);
tmp8 |= NATIVE_MODE_ALL; tmp8 |= NATIVE_MODE_ALL;
pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8); pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
} }
...@@ -303,7 +306,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -303,7 +306,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
u8 tmp8; u8 tmp8;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
...@@ -318,8 +321,9 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -318,8 +321,9 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (board_id == vt6420) { if (board_id == vt6420) {
pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8); pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8);
if (tmp8 & SATA_2DEV) { if (tmp8 & SATA_2DEV) {
printk(KERN_ERR DRV_NAME "(%s): SATA master/slave not supported (0x%x)\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev), (int) tmp8); "SATA master/slave not supported (0x%x)\n",
(int) tmp8);
rc = -EIO; rc = -EIO;
goto err_out_regions; goto err_out_regions;
} }
...@@ -332,10 +336,11 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -332,10 +336,11 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++) for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++)
if ((pci_resource_start(pdev, i) == 0) || if ((pci_resource_start(pdev, i) == 0) ||
(pci_resource_len(pdev, i) < bar_sizes[i])) { (pci_resource_len(pdev, i) < bar_sizes[i])) {
printk(KERN_ERR DRV_NAME "(%s): invalid PCI BAR %u (sz 0x%lx, val 0x%lx)\n", dev_printk(KERN_ERR, &pdev->dev,
pci_name(pdev), i, "invalid PCI BAR %u (sz 0x%lx, val 0x%lx)\n",
pci_resource_start(pdev, i), i,
pci_resource_len(pdev, i)); pci_resource_start(pdev, i),
pci_resource_len(pdev, i));
rc = -ENODEV; rc = -ENODEV;
goto err_out_regions; goto err_out_regions;
} }
...@@ -353,8 +358,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -353,8 +358,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent = vt6421_init_probe_ent(pdev); probe_ent = vt6421_init_probe_ent(pdev);
if (!probe_ent) { if (!probe_ent) {
printk(KERN_ERR DRV_NAME "(%s): out of memory\n", dev_printk(KERN_ERR, &pdev->dev, "out of memory\n");
pci_name(pdev));
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
} }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/device.h>
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <linux/libata.h> #include <linux/libata.h>
...@@ -295,7 +296,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d ...@@ -295,7 +296,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
int rc; int rc;
if (!printed_version++) if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
rc = pci_enable_device(pdev); rc = pci_enable_device(pdev);
if (rc) if (rc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册