public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Jeff Garzik <jgarzik@redhat.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 08/12] ahci: Factor out PCI specifics from ahci_print_info()
Date: Tue, 2 Mar 2010 21:29:38 +0300	[thread overview]
Message-ID: <20100302182938.GH3445@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100302182850.GA32057@oksana.dev.rtsoft.ru>

Introduce ahci_pci_print_info() that now handles PCI stuff.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/ata/ahci.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index aaeac15..18443e9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -2627,15 +2627,12 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
 	return 0;
 }
 
-static void ahci_print_info(struct ata_host *host)
+static void ahci_print_info(struct ata_host *host, const char *scc_s)
 {
 	struct ahci_host_priv *hpriv = host->private_data;
-	struct pci_dev *pdev = to_pci_dev(host->dev);
 	void __iomem *mmio = hpriv->mmio;
 	u32 vers, cap, cap2, impl, speed;
 	const char *speed_s;
-	u16 cc;
-	const char *scc_s;
 
 	vers = readl(mmio + HOST_VERSION);
 	cap = hpriv->cap;
@@ -2652,17 +2649,7 @@ static void ahci_print_info(struct ata_host *host)
 	else
 		speed_s = "?";
 
-	pci_read_config_word(pdev, 0x0a, &cc);
-	if (cc == PCI_CLASS_STORAGE_IDE)
-		scc_s = "IDE";
-	else if (cc == PCI_CLASS_STORAGE_SATA)
-		scc_s = "SATA";
-	else if (cc == PCI_CLASS_STORAGE_RAID)
-		scc_s = "RAID";
-	else
-		scc_s = "unknown";
-
-	dev_printk(KERN_INFO, &pdev->dev,
+	dev_info(host->dev,
 		"AHCI %02x%02x.%02x%02x "
 		"%u slots %u ports %s Gbps 0x%x impl %s mode\n"
 		,
@@ -2678,7 +2665,7 @@ static void ahci_print_info(struct ata_host *host)
 		impl,
 		scc_s);
 
-	dev_printk(KERN_INFO, &pdev->dev,
+	dev_info(host->dev,
 		"flags: "
 		"%s%s%s%s%s%s%s"
 		"%s%s%s%s%s%s%s"
@@ -2708,6 +2695,25 @@ static void ahci_print_info(struct ata_host *host)
 		);
 }
 
+static void ahci_pci_print_info(struct ata_host *host)
+{
+	struct pci_dev *pdev = to_pci_dev(host->dev);
+	u16 cc;
+	const char *scc_s;
+
+	pci_read_config_word(pdev, 0x0a, &cc);
+	if (cc == PCI_CLASS_STORAGE_IDE)
+		scc_s = "IDE";
+	else if (cc == PCI_CLASS_STORAGE_SATA)
+		scc_s = "SATA";
+	else if (cc == PCI_CLASS_STORAGE_RAID)
+		scc_s = "RAID";
+	else
+		scc_s = "unknown";
+
+	ahci_print_info(host, scc_s);
+}
+
 /* On ASUS P5W DH Deluxe, the second port of PCI device 00:1f.2 is
  * hardwired to on-board SIMG 4726.  The chipset is ICH8 and doesn't
  * support PMP and the 4726 either directly exports the device
@@ -3229,7 +3235,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		return rc;
 
 	ahci_pci_init_controller(host);
-	ahci_print_info(host);
+	ahci_pci_print_info(host);
 
 	pci_set_master(pdev);
 	return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
-- 
1.7.0


  parent reply	other threads:[~2010-03-02 18:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 18:28 [PATCH RFC 0/12] ahci: Add support for non-PCI devices Anton Vorontsov
2010-03-02 18:29 ` [PATCH 01/12] ahci: Fix some sparse warnings Anton Vorontsov
2010-03-02 18:29 ` [PATCH 02/12] ahci: Get rid of host->iomap usage Anton Vorontsov
2010-03-02 18:29 ` [PATCH 03/12] ahci: Factor out PCI specifics from ahci_save_initial_config() Anton Vorontsov
2010-03-02 18:29 ` [PATCH 04/12] ahci: Get rid of pci_dev argument in ahci_save_initial_config() Anton Vorontsov
2010-03-02 18:29 ` [PATCH 05/12] ahci: Factor out PCI specifics from ahci_reset_controller() Anton Vorontsov
2010-03-02 18:29 ` [PATCH 06/12] ahci: Get rid of pci_dev argument in ahci_port_init() Anton Vorontsov
2010-03-02 18:29 ` [PATCH 07/12] ahci: Factor out PCI specifics from ahci_init_controller() Anton Vorontsov
2010-03-02 18:29 ` Anton Vorontsov [this message]
2010-03-02 18:29 ` [PATCH 09/12] ahci: Introduce ahci_set_em_messages() Anton Vorontsov
2010-03-02 21:18   ` Sergei Shtylyov
2010-03-02 23:19     ` Jeff Garzik
2010-03-03 10:40       ` Sergei Shtylyov
2010-03-03 11:41         ` Jeff Garzik
2010-03-03 14:38           ` Greg Freemyer
2010-03-02 18:29 ` [PATCH 10/12] ahci: Move PCI code into ahci_pci.c Anton Vorontsov
2010-03-02 18:29 ` [PATCH 11/12] ahci: Export generic AHCI symbols Anton Vorontsov
2010-03-02 18:29 ` [PATCH 12/12] ahci: Add platform driver Anton Vorontsov
2010-03-02 19:41   ` Sergei Shtylyov
2010-03-03 13:14     ` Anton Vorontsov
2010-03-02 21:34 ` [PATCH RFC 0/12] ahci: Add support for non-PCI devices Jeff Garzik
2010-03-03 13:15   ` Anton Vorontsov
2010-03-03 13:40     ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100302182938.GH3445@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=jgarzik@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox