aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-06-17 02:49:55 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-20 04:59:21 -0400
commite6faf082cd75d6dcdcf89258ddf40c6855df87a1 (patch)
treef0a74b0233a8524de32a21ae2c12300803f14c00
parent638ebcc81f40b160f5e8b161e690e9b1b9503c1e (diff)
[PATCH] sata_nv: kill struct nv_host_desc and nv_host
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> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/scsi/sata_nv.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/drivers/scsi/sata_nv.c b/drivers/scsi/sata_nv.c
index 70f81941f76e..e9c4547723c8 100644
--- a/drivers/scsi/sata_nv.c
+++ b/drivers/scsi/sata_nv.c
@@ -89,7 +89,6 @@ static irqreturn_t nv_interrupt (int irq, void *dev_instance,
89 struct pt_regs *regs); 89 struct pt_regs *regs);
90static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg); 90static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg);
91static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); 91static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
92static void nv_host_stop (struct ata_host_set *host_set);
93 92
94enum nv_host_type 93enum nv_host_type
95{ 94{
@@ -137,30 +136,6 @@ static const struct pci_device_id nv_pci_tbl[] = {
137 { 0, } /* terminate list */ 136 { 0, } /* terminate list */
138}; 137};
139 138
140struct nv_host_desc
141{
142 enum nv_host_type host_type;
143};
144static struct nv_host_desc nv_device_tbl[] = {
145 {
146 .host_type = GENERIC,
147 },
148 {
149 .host_type = NFORCE2,
150 },
151 {
152 .host_type = NFORCE3,
153 },
154 { .host_type = CK804,
155 },
156};
157
158struct nv_host
159{
160 struct nv_host_desc *host_desc;
161 unsigned long host_flags;
162};
163
164static struct pci_driver nv_pci_driver = { 139static struct pci_driver nv_pci_driver = {
165 .name = DRV_NAME, 140 .name = DRV_NAME,
166 .id_table = nv_pci_tbl, 141 .id_table = nv_pci_tbl,
@@ -208,7 +183,7 @@ static const struct ata_port_operations nv_ops = {
208 .scr_write = nv_scr_write, 183 .scr_write = nv_scr_write,
209 .port_start = ata_port_start, 184 .port_start = ata_port_start,
210 .port_stop = ata_port_stop, 185 .port_stop = ata_port_stop,
211 .host_stop = nv_host_stop, 186 .host_stop = ata_pci_host_stop,
212}; 187};
213 188
214/* FIXME: The hardware provides the necessary SATA PHY controls 189/* FIXME: The hardware provides the necessary SATA PHY controls
@@ -287,19 +262,9 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
287 iowrite32(val, (void __iomem *)ap->ioaddr.scr_addr + (sc_reg * 4)); 262 iowrite32(val, (void __iomem *)ap->ioaddr.scr_addr + (sc_reg * 4));
288} 263}
289 264
290static void nv_host_stop (struct ata_host_set *host_set)
291{
292 struct nv_host *host = host_set->private_data;
293
294 kfree(host);
295
296 ata_pci_host_stop(host_set);
297}
298
299static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 265static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
300{ 266{
301 static int printed_version = 0; 267 static int printed_version = 0;
302 struct nv_host *host;
303 struct ata_port_info *ppi; 268 struct ata_port_info *ppi;
304 struct ata_probe_ent *probe_ent; 269 struct ata_probe_ent *probe_ent;
305 int pci_dev_busy = 0; 270 int pci_dev_busy = 0;
@@ -341,19 +306,10 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
341 if (!probe_ent) 306 if (!probe_ent)
342 goto err_out_regions; 307 goto err_out_regions;
343 308
344 host = kmalloc(sizeof(struct nv_host), GFP_KERNEL);
345 if (!host)
346 goto err_out_free_ent;
347
348 memset(host, 0, sizeof(struct nv_host));
349 host->host_desc = &nv_device_tbl[ent->driver_data];
350
351 probe_ent->private_data = host;
352
353 probe_ent->mmio_base = pci_iomap(pdev, 5, 0); 309 probe_ent->mmio_base = pci_iomap(pdev, 5, 0);
354 if (!probe_ent->mmio_base) { 310 if (!probe_ent->mmio_base) {
355 rc = -EIO; 311 rc = -EIO;
356 goto err_out_free_host; 312 goto err_out_free_ent;
357 } 313 }
358 314
359 base = (unsigned long)probe_ent->mmio_base; 315 base = (unsigned long)probe_ent->mmio_base;
@@ -373,8 +329,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
373 329
374err_out_iounmap: 330err_out_iounmap:
375 pci_iounmap(pdev, probe_ent->mmio_base); 331 pci_iounmap(pdev, probe_ent->mmio_base);
376err_out_free_host:
377 kfree(host);
378err_out_free_ent: 332err_out_free_ent:
379 kfree(probe_ent); 333 kfree(probe_ent);
380err_out_regions: 334err_out_regions: