linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: jgarzik@pobox.com, linux-ide@vger.kernel.org
Cc: Tejun Heo <htejun@gmail.com>
Subject: [PATCH 2/6] sata_nv: kill struct nv_host_desc and nv_host
Date: Sat, 17 Jun 2006 15:49:55 +0900	[thread overview]
Message-ID: <11505269952012-git-send-email-htejun@gmail.com> (raw)
In-Reply-To: <11505269953650-git-send-email-htejun@gmail.com>

nv_host_desc and nv_host are used to discern different generations of
nv controllers.  Kill those.  New EH/hotplug implementation will use
standard port_info/ata_port_operations for that.

Signed-off-by: Tejun Heo <htejun@gmail.com>

---

 drivers/scsi/sata_nv.c |   50 ++----------------------------------------------
 1 files changed, 2 insertions(+), 48 deletions(-)

17f86185988378c641cac6a70a2a3244b9f69909
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 70f8194..e9c4547 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -89,7 +89,6 @@ static irqreturn_t nv_interrupt (int irq
 				 struct pt_regs *regs);
 static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg);
 static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
-static void nv_host_stop (struct ata_host_set *host_set);
 
 enum nv_host_type
 {
@@ -137,30 +136,6 @@ static const struct pci_device_id nv_pci
 	{ 0, } /* terminate list */
 };
 
-struct nv_host_desc
-{
-	enum nv_host_type	host_type;
-};
-static struct nv_host_desc nv_device_tbl[] = {
-	{
-		.host_type	= GENERIC,
-	},
-	{
-		.host_type	= NFORCE2,
-	},
-	{
-		.host_type	= NFORCE3,
-	},
-	{	.host_type	= CK804,
-	},
-};
-
-struct nv_host
-{
-	struct nv_host_desc	*host_desc;
-	unsigned long		host_flags;
-};
-
 static struct pci_driver nv_pci_driver = {
 	.name			= DRV_NAME,
 	.id_table		= nv_pci_tbl,
@@ -208,7 +183,7 @@ static const struct ata_port_operations 
 	.scr_write		= nv_scr_write,
 	.port_start		= ata_port_start,
 	.port_stop		= ata_port_stop,
-	.host_stop		= nv_host_stop,
+	.host_stop		= ata_pci_host_stop,
 };
 
 /* FIXME: The hardware provides the necessary SATA PHY controls
@@ -287,19 +262,9 @@ static void nv_scr_write (struct ata_por
 	iowrite32(val, (void __iomem *)ap->ioaddr.scr_addr + (sc_reg * 4));
 }
 
-static void nv_host_stop (struct ata_host_set *host_set)
-{
-	struct nv_host *host = host_set->private_data;
-
-	kfree(host);
-
-	ata_pci_host_stop(host_set);
-}
-
 static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	static int printed_version = 0;
-	struct nv_host *host;
 	struct ata_port_info *ppi;
 	struct ata_probe_ent *probe_ent;
 	int pci_dev_busy = 0;
@@ -341,19 +306,10 @@ static int nv_init_one (struct pci_dev *
 	if (!probe_ent)
 		goto err_out_regions;
 
-	host = kmalloc(sizeof(struct nv_host), GFP_KERNEL);
-	if (!host)
-		goto err_out_free_ent;
-
-	memset(host, 0, sizeof(struct nv_host));
-	host->host_desc = &nv_device_tbl[ent->driver_data];
-
-	probe_ent->private_data = host;
-
 	probe_ent->mmio_base = pci_iomap(pdev, 5, 0);
 	if (!probe_ent->mmio_base) {
 		rc = -EIO;
-		goto err_out_free_host;
+		goto err_out_free_ent;
 	}
 
 	base = (unsigned long)probe_ent->mmio_base;
@@ -373,8 +329,6 @@ static int nv_init_one (struct pci_dev *
 
 err_out_iounmap:
 	pci_iounmap(pdev, probe_ent->mmio_base);
-err_out_free_host:
-	kfree(host);
 err_out_free_ent:
 	kfree(probe_ent);
 err_out_regions:
-- 
1.3.2



  parent reply	other threads:[~2006-06-17  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-17  6:49 [PATCHSET] sata_nv: convert to new EH and add hotplug support, take 2 Tejun Heo
2006-06-17  6:49 ` [PATCH 1/6] sata_nv: kill not-working hotplug code Tejun Heo
2006-06-20  9:09   ` Jeff Garzik
2006-06-20  9:14     ` Tejun Heo
2006-06-17  6:49 ` Tejun Heo [this message]
2006-06-17  6:49 ` [PATCH 3/6] sata_nv: simplify constants Tejun Heo
2006-06-17  6:49 ` [PATCH 6/6] sata_nv: add hotplug support Tejun Heo
2006-06-17  6:49 ` [PATCH 5/6] sata_nv: convert to new EH Tejun Heo
2006-06-17  6:49 ` [PATCH 4/6] sata_nv: better irq handlers Tejun Heo

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=11505269952012-git-send-email-htejun@gmail.com \
    --to=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).