ata: Add and use ata_print_version_once
[deliverable/linux.git] / drivers / ata / ahci.c
index 71afe0371311d7475e7034bb5ab1e483b2d3ce68..6ea99df87146ad250dffcb52b9c16997f61e7384 100644 (file)
@@ -540,9 +540,8 @@ static int ahci_sb600_softreset(struct ata_link *link, unsigned int *class,
        if (rc == -EIO) {
                irq_sts = readl(port_mmio + PORT_IRQ_STAT);
                if (irq_sts & PORT_IRQ_BAD_PMP) {
-                       ata_link_printk(link, KERN_WARNING,
-                                       "applying SB600 PMP SRST workaround "
-                                       "and retrying\n");
+                       ata_link_warn(link,
+                                     "applying SB600 PMP SRST workaround and retrying\n");
                        rc = ahci_do_softreset(link, class, 0, deadline,
                                               ahci_check_ready);
                }
@@ -629,8 +628,8 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
 
        if (mesg.event & PM_EVENT_SUSPEND &&
            hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
-               dev_printk(KERN_ERR, &pdev->dev,
-                          "BIOS update required for suspend/resume\n");
+               dev_err(&pdev->dev,
+                       "BIOS update required for suspend/resume\n");
                return -EIO;
        }
 
@@ -681,22 +680,21 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
                if (rc) {
                        rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
                        if (rc) {
-                               dev_printk(KERN_ERR, &pdev->dev,
-                                          "64-bit DMA enable failed\n");
+                               dev_err(&pdev->dev,
+                                       "64-bit DMA enable failed\n");
                                return rc;
                        }
                }
        } else {
                rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
                if (rc) {
-                       dev_printk(KERN_ERR, &pdev->dev,
-                                  "32-bit DMA enable failed\n");
+                       dev_err(&pdev->dev, "32-bit DMA enable failed\n");
                        return rc;
                }
                rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
                if (rc) {
-                       dev_printk(KERN_ERR, &pdev->dev,
-                                  "32-bit consistent DMA enable failed\n");
+                       dev_err(&pdev->dev,
+                               "32-bit consistent DMA enable failed\n");
                        return rc;
                }
        }
@@ -759,8 +757,8 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
            dmi_check_system(sysids)) {
                struct ata_port *ap = host->ports[1];
 
-               dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH "
-                          "Deluxe on-board SIMG4726 workaround\n");
+               dev_info(&pdev->dev,
+                        "enabling ASUS P5W DH Deluxe on-board SIMG4726 workaround\n");
 
                ap->ops = &ahci_p5wdh_ops;
                ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA;
@@ -831,14 +829,14 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
        if (strcmp(buf, match->driver_data) >= 0)
                goto enable_64bit;
        else {
-               dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, "
-                          "forcing 32bit DMA, update BIOS\n", match->ident);
+               dev_warn(&pdev->dev,
+                        "%s: BIOS too old, forcing 32bit DMA, update BIOS\n",
+                        match->ident);
                return false;
        }
 
 enable_64bit:
-       dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n",
-                  match->ident);
+       dev_warn(&pdev->dev, "%s: enabling 64bit DMA\n", match->ident);
        return true;
 }
 
@@ -1041,9 +1039,8 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
                return;
 
        filter = (unsigned long)dmi->driver_data;
-       dev_printk(KERN_INFO, host->dev,
-                  "applying extra ACPI _GTF filter 0x%x for %s\n",
-                  filter, dmi->ident);
+       dev_info(host->dev, "applying extra ACPI _GTF filter 0x%x for %s\n",
+                filter, dmi->ident);
 
        for (i = 0; i < host->n_ports; i++) {
                struct ata_port *ap = host->ports[i];
@@ -1062,7 +1059,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host)
 
 static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
-       static int printed_version;
        unsigned int board_id = ent->driver_data;
        struct ata_port_info pi = ahci_port_info[board_id];
        const struct ata_port_info *ppi[] = { &pi, NULL };
@@ -1075,8 +1071,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        WARN_ON((int)ATA_MAX_QUEUE > AHCI_MAX_CMDS);
 
-       if (!printed_version++)
-               dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
+       ata_print_version_once(&pdev->dev, DRV_VERSION);
 
        /* The AHCI driver can only drive the SATA ports, the PATA driver
           can drive them all so if both drivers are selected make sure
@@ -1099,8 +1094,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
         * that for SAS drives they're out of luck.
         */
        if (pdev->vendor == PCI_VENDOR_ID_PROMISE)
-               dev_printk(KERN_INFO, &pdev->dev, "PDC42819 "
-                          "can only drive SATA devices with this driver\n");
+               dev_info(&pdev->dev,
+                        "PDC42819 can only drive SATA devices with this driver\n");
 
        /* acquire resources */
        rc = pcim_enable_device(pdev);
@@ -1126,8 +1121,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
                 */
                pci_read_config_byte(pdev, ICH_MAP, &map);
                if (map & 0x3) {
-                       dev_printk(KERN_INFO, &pdev->dev, "controller is in "
-                                  "combined mode, can't enable AHCI mode\n");
+                       dev_info(&pdev->dev,
+                                "controller is in combined mode, can't enable AHCI mode\n");
                        return -ENODEV;
                }
        }
@@ -1184,8 +1179,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        if (ahci_broken_suspend(pdev)) {
                hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
-               dev_printk(KERN_WARNING, &pdev->dev,
-                          "BIOS update required for suspend/resume\n");
+               dev_warn(&pdev->dev,
+                        "BIOS update required for suspend/resume\n");
        }
 
        if (ahci_broken_online(pdev)) {
This page took 0.027339 seconds and 5 git commands to generate.