aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_nv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_nv.c')
-rw-r--r--drivers/ata/sata_nv.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index be46df75ab5a..27c22feebf30 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -81,7 +81,7 @@ enum {
81}; 81};
82 82
83static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); 83static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
84static void nv_ck804_host_stop(struct ata_host_set *host_set); 84static void nv_ck804_host_stop(struct ata_host *host);
85static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance, 85static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance,
86 struct pt_regs *regs); 86 struct pt_regs *regs);
87static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance, 87static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance,
@@ -257,7 +257,7 @@ static struct ata_port_info nv_port_info[] = {
257 /* generic */ 257 /* generic */
258 { 258 {
259 .sht = &nv_sht, 259 .sht = &nv_sht,
260 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, 260 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
261 .pio_mask = NV_PIO_MASK, 261 .pio_mask = NV_PIO_MASK,
262 .mwdma_mask = NV_MWDMA_MASK, 262 .mwdma_mask = NV_MWDMA_MASK,
263 .udma_mask = NV_UDMA_MASK, 263 .udma_mask = NV_UDMA_MASK,
@@ -266,7 +266,7 @@ static struct ata_port_info nv_port_info[] = {
266 /* nforce2/3 */ 266 /* nforce2/3 */
267 { 267 {
268 .sht = &nv_sht, 268 .sht = &nv_sht,
269 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, 269 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
270 .pio_mask = NV_PIO_MASK, 270 .pio_mask = NV_PIO_MASK,
271 .mwdma_mask = NV_MWDMA_MASK, 271 .mwdma_mask = NV_MWDMA_MASK,
272 .udma_mask = NV_UDMA_MASK, 272 .udma_mask = NV_UDMA_MASK,
@@ -275,7 +275,7 @@ static struct ata_port_info nv_port_info[] = {
275 /* ck804 */ 275 /* ck804 */
276 { 276 {
277 .sht = &nv_sht, 277 .sht = &nv_sht,
278 .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, 278 .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
279 .pio_mask = NV_PIO_MASK, 279 .pio_mask = NV_PIO_MASK,
280 .mwdma_mask = NV_MWDMA_MASK, 280 .mwdma_mask = NV_MWDMA_MASK,
281 .udma_mask = NV_UDMA_MASK, 281 .udma_mask = NV_UDMA_MASK,
@@ -292,17 +292,17 @@ MODULE_VERSION(DRV_VERSION);
292static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance, 292static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance,
293 struct pt_regs *regs) 293 struct pt_regs *regs)
294{ 294{
295 struct ata_host_set *host_set = dev_instance; 295 struct ata_host *host = dev_instance;
296 unsigned int i; 296 unsigned int i;
297 unsigned int handled = 0; 297 unsigned int handled = 0;
298 unsigned long flags; 298 unsigned long flags;
299 299
300 spin_lock_irqsave(&host_set->lock, flags); 300 spin_lock_irqsave(&host->lock, flags);
301 301
302 for (i = 0; i < host_set->n_ports; i++) { 302 for (i = 0; i < host->n_ports; i++) {
303 struct ata_port *ap; 303 struct ata_port *ap;
304 304
305 ap = host_set->ports[i]; 305 ap = host->ports[i];
306 if (ap && 306 if (ap &&
307 !(ap->flags & ATA_FLAG_DISABLED)) { 307 !(ap->flags & ATA_FLAG_DISABLED)) {
308 struct ata_queued_cmd *qc; 308 struct ata_queued_cmd *qc;
@@ -318,7 +318,7 @@ static irqreturn_t nv_generic_interrupt(int irq, void *dev_instance,
318 318
319 } 319 }
320 320
321 spin_unlock_irqrestore(&host_set->lock, flags); 321 spin_unlock_irqrestore(&host->lock, flags);
322 322
323 return IRQ_RETVAL(handled); 323 return IRQ_RETVAL(handled);
324} 324}
@@ -354,12 +354,12 @@ static int nv_host_intr(struct ata_port *ap, u8 irq_stat)
354 return 1; 354 return 1;
355} 355}
356 356
357static irqreturn_t nv_do_interrupt(struct ata_host_set *host_set, u8 irq_stat) 357static irqreturn_t nv_do_interrupt(struct ata_host *host, u8 irq_stat)
358{ 358{
359 int i, handled = 0; 359 int i, handled = 0;
360 360
361 for (i = 0; i < host_set->n_ports; i++) { 361 for (i = 0; i < host->n_ports; i++) {
362 struct ata_port *ap = host_set->ports[i]; 362 struct ata_port *ap = host->ports[i];
363 363
364 if (ap && !(ap->flags & ATA_FLAG_DISABLED)) 364 if (ap && !(ap->flags & ATA_FLAG_DISABLED))
365 handled += nv_host_intr(ap, irq_stat); 365 handled += nv_host_intr(ap, irq_stat);
@@ -373,14 +373,14 @@ static irqreturn_t nv_do_interrupt(struct ata_host_set *host_set, u8 irq_stat)
373static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance, 373static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance,
374 struct pt_regs *regs) 374 struct pt_regs *regs)
375{ 375{
376 struct ata_host_set *host_set = dev_instance; 376 struct ata_host *host = dev_instance;
377 u8 irq_stat; 377 u8 irq_stat;
378 irqreturn_t ret; 378 irqreturn_t ret;
379 379
380 spin_lock(&host_set->lock); 380 spin_lock(&host->lock);
381 irq_stat = inb(host_set->ports[0]->ioaddr.scr_addr + NV_INT_STATUS); 381 irq_stat = inb(host->ports[0]->ioaddr.scr_addr + NV_INT_STATUS);
382 ret = nv_do_interrupt(host_set, irq_stat); 382 ret = nv_do_interrupt(host, irq_stat);
383 spin_unlock(&host_set->lock); 383 spin_unlock(&host->lock);
384 384
385 return ret; 385 return ret;
386} 386}
@@ -388,14 +388,14 @@ static irqreturn_t nv_nf2_interrupt(int irq, void *dev_instance,
388static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance, 388static irqreturn_t nv_ck804_interrupt(int irq, void *dev_instance,
389 struct pt_regs *regs) 389 struct pt_regs *regs)
390{ 390{
391 struct ata_host_set *host_set = dev_instance; 391 struct ata_host *host = dev_instance;
392 u8 irq_stat; 392 u8 irq_stat;
393 irqreturn_t ret; 393 irqreturn_t ret;
394 394
395 spin_lock(&host_set->lock); 395 spin_lock(&host->lock);
396 irq_stat = readb(host_set->mmio_base + NV_INT_STATUS_CK804); 396 irq_stat = readb(host->mmio_base + NV_INT_STATUS_CK804);
397 ret = nv_do_interrupt(host_set, irq_stat); 397 ret = nv_do_interrupt(host, irq_stat);
398 spin_unlock(&host_set->lock); 398 spin_unlock(&host->lock);
399 399
400 return ret; 400 return ret;
401} 401}
@@ -418,7 +418,7 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
418 418
419static void nv_nf2_freeze(struct ata_port *ap) 419static void nv_nf2_freeze(struct ata_port *ap)
420{ 420{
421 unsigned long scr_addr = ap->host_set->ports[0]->ioaddr.scr_addr; 421 unsigned long scr_addr = ap->host->ports[0]->ioaddr.scr_addr;
422 int shift = ap->port_no * NV_INT_PORT_SHIFT; 422 int shift = ap->port_no * NV_INT_PORT_SHIFT;
423 u8 mask; 423 u8 mask;
424 424
@@ -429,7 +429,7 @@ static void nv_nf2_freeze(struct ata_port *ap)
429 429
430static void nv_nf2_thaw(struct ata_port *ap) 430static void nv_nf2_thaw(struct ata_port *ap)
431{ 431{
432 unsigned long scr_addr = ap->host_set->ports[0]->ioaddr.scr_addr; 432 unsigned long scr_addr = ap->host->ports[0]->ioaddr.scr_addr;
433 int shift = ap->port_no * NV_INT_PORT_SHIFT; 433 int shift = ap->port_no * NV_INT_PORT_SHIFT;
434 u8 mask; 434 u8 mask;
435 435
@@ -442,7 +442,7 @@ static void nv_nf2_thaw(struct ata_port *ap)
442 442
443static void nv_ck804_freeze(struct ata_port *ap) 443static void nv_ck804_freeze(struct ata_port *ap)
444{ 444{
445 void __iomem *mmio_base = ap->host_set->mmio_base; 445 void __iomem *mmio_base = ap->host->mmio_base;
446 int shift = ap->port_no * NV_INT_PORT_SHIFT; 446 int shift = ap->port_no * NV_INT_PORT_SHIFT;
447 u8 mask; 447 u8 mask;
448 448
@@ -453,7 +453,7 @@ static void nv_ck804_freeze(struct ata_port *ap)
453 453
454static void nv_ck804_thaw(struct ata_port *ap) 454static void nv_ck804_thaw(struct ata_port *ap)
455{ 455{
456 void __iomem *mmio_base = ap->host_set->mmio_base; 456 void __iomem *mmio_base = ap->host->mmio_base;
457 int shift = ap->port_no * NV_INT_PORT_SHIFT; 457 int shift = ap->port_no * NV_INT_PORT_SHIFT;
458 u8 mask; 458 u8 mask;
459 459
@@ -568,9 +568,9 @@ err_out:
568 return rc; 568 return rc;
569} 569}
570 570
571static void nv_ck804_host_stop(struct ata_host_set *host_set) 571static void nv_ck804_host_stop(struct ata_host *host)
572{ 572{
573 struct pci_dev *pdev = to_pci_dev(host_set->dev); 573 struct pci_dev *pdev = to_pci_dev(host->dev);
574 u8 regval; 574 u8 regval;
575 575
576 /* disable SATA space for CK804 */ 576 /* disable SATA space for CK804 */
@@ -578,7 +578,7 @@ static void nv_ck804_host_stop(struct ata_host_set *host_set)
578 regval &= ~NV_MCP_SATA_CFG_20_SATA_SPACE_EN; 578 regval &= ~NV_MCP_SATA_CFG_20_SATA_SPACE_EN;
579 pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval); 579 pci_write_config_byte(pdev, NV_MCP_SATA_CFG_20, regval);
580 580
581 ata_pci_host_stop(host_set); 581 ata_pci_host_stop(host);
582} 582}
583 583
584static int __init nv_init(void) 584static int __init nv_init(void)