From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 03/11] ahci: Get rid of pci_dev argument in ahci_save_initial_config()
Date: Wed, 3 Mar 2010 20:17:37 +0300 [thread overview]
Message-ID: <20100303171737.GC12362@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100303171713.GA6322@oksana.dev.rtsoft.ru>
To make the function generic we have to get rid of "struct pci_dev *",
so let's pass just a "struct devce *".
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
drivers/ata/ahci.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 98c9c6a..9d9af3c 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -824,7 +824,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,
/**
* ahci_save_initial_config - Save and fixup initial config values
- * @pdev: target PCI device
+ * @dev: target AHCI device
* @hpriv: host private area to store config values
* @force_port_map: force port map to a specified value
* @mask_port_map: mask out particular bits from port map
@@ -839,7 +839,7 @@ static ssize_t ahci_show_port_cmd(struct device *dev,
* LOCKING:
* None.
*/
-static void ahci_save_initial_config(struct pci_dev *pdev,
+static void ahci_save_initial_config(struct device *dev,
struct ahci_host_priv *hpriv,
unsigned int force_port_map,
unsigned int mask_port_map)
@@ -867,45 +867,43 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
/* some chips have errata preventing 64bit use */
if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_printk(KERN_INFO, dev,
"controller can't do 64bit DMA, forcing 32bit\n");
cap &= ~HOST_CAP_64;
}
if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_printk(KERN_INFO, dev,
"controller can't do NCQ, turning off CAP_NCQ\n");
cap &= ~HOST_CAP_NCQ;
}
if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_printk(KERN_INFO, dev,
"controller can do NCQ, turning on CAP_NCQ\n");
cap |= HOST_CAP_NCQ;
}
if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_printk(KERN_INFO, dev,
"controller can't do PMP, turning off CAP_PMP\n");
cap &= ~HOST_CAP_PMP;
}
if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
- dev_printk(KERN_INFO, &pdev->dev,
+ dev_printk(KERN_INFO, dev,
"controller can't do SNTF, turning off CAP_SNTF\n");
cap &= ~HOST_CAP_SNTF;
}
if (force_port_map && port_map != force_port_map) {
- dev_printk(KERN_INFO, &pdev->dev,
- "forcing port_map 0x%x -> 0x%x\n",
+ dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n",
port_map, force_port_map);
port_map = force_port_map;
}
if (mask_port_map) {
- dev_printk(KERN_ERR, &pdev->dev,
- "masking port_map 0x%x -> 0x%x\n",
+ dev_printk(KERN_ERR, dev, "masking port_map 0x%x -> 0x%x\n",
port_map,
port_map & mask_port_map);
port_map &= mask_port_map;
@@ -923,7 +921,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
* port_map and let it be generated from n_ports.
*/
if (map_ports > ahci_nr_ports(cap)) {
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_printk(KERN_WARNING, dev,
"implemented port map (0x%x) contains more "
"ports than nr_ports (%u), using nr_ports\n",
port_map, ahci_nr_ports(cap));
@@ -934,7 +932,7 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
/* fabricate port_map from cap.nr_ports */
if (!port_map) {
port_map = (1 << ahci_nr_ports(cap)) - 1;
- dev_printk(KERN_WARNING, &pdev->dev,
+ dev_printk(KERN_WARNING, dev,
"forcing PORTS_IMPL to 0x%x\n", port_map);
/* write the fixed up value to the PI register */
@@ -972,7 +970,8 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,
"Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n");
}
- ahci_save_initial_config(pdev, hpriv, force_port_map, mask_port_map);
+ ahci_save_initial_config(&pdev->dev, hpriv, force_port_map,
+ mask_port_map);
}
/**
--
1.7.0
next prev parent reply other threads:[~2010-03-03 17:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 17:17 [PATCH 0/11] ahci: Add support for non-PCI devices Anton Vorontsov
2010-03-03 17:17 ` [PATCH 01/11] ahci: Get rid of host->iomap usage Anton Vorontsov
2010-03-03 18:45 ` Jeff Garzik
2010-03-03 18:49 ` Jeff Garzik
2010-03-03 17:17 ` [PATCH 02/11] ahci: Factor out PCI specifics from ahci_save_initial_config() Anton Vorontsov
2010-03-03 17:17 ` Anton Vorontsov [this message]
2010-03-03 17:17 ` [PATCH 04/11] ahci: Factor out PCI specifics from ahci_reset_controller() Anton Vorontsov
2010-03-03 17:17 ` [PATCH 05/11] ahci: Get rid of pci_dev argument in ahci_port_init() Anton Vorontsov
2010-03-03 17:17 ` [PATCH 06/11] ahci: Factor out PCI specifics from ahci_init_controller() Anton Vorontsov
2010-03-03 17:17 ` [PATCH 07/11] ahci: Factor out PCI specifics from ahci_print_info() Anton Vorontsov
2010-03-03 17:17 ` [PATCH 08/11] ahci: Introduce ahci_set_em_messages() Anton Vorontsov
2010-03-03 20:52 ` Jeff Garzik
2010-03-03 17:17 ` [PATCH 09/11] ahci: Move generic code into libahci Anton Vorontsov
2010-03-03 17:33 ` Sergei Shtylyov
2010-03-03 17:45 ` Anton Vorontsov
2010-03-03 18:43 ` Jeff Garzik
2010-03-03 21:58 ` Mark Lord
2010-03-03 17:17 ` [PATCH 10/11] ahci: Export generic AHCI symbols, turn libahci into a separate module Anton Vorontsov
2010-03-03 17:53 ` Sergei Shtylyov
2010-03-03 18:08 ` Anton Vorontsov
2010-03-03 18:14 ` Anton Vorontsov
2010-03-03 18:34 ` Jeff Garzik
2010-03-03 18:42 ` Anton Vorontsov
2010-03-03 17:17 ` [PATCH 11/11] ahci: Add platform driver Anton Vorontsov
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=20100303171737.GC12362@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sshtylyov@mvista.com \
/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;
as well as URLs for NNTP newsgroup(s).