Fix build failure for drivers/ata/pata_scc.c

The commit d4b2bab4f26345ea1803feb23ea92fbe3f6b77bc added deadline support
to prereset and reset methods to libbata the pata_scc driver wasn't
converted. This patch is a naive attempt to bring this driver up to
scratch.

Build failures are:
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:870: error: too few arguments to function 'ata_std_prereset'
drivers/ata/pata_scc.c: In function 'scc_error_handler':
drivers/ata/pata_scc.c:916: warning: passing argument 2 of 'ata_bmdma_drive_eh' from incompatible pointer type
drivers/ata/pata_scc.c:916: warning: passing argument 3 of 'ata_bmdma_drive_eh' from incompatible pointer type
drivers/ata/pata_scc.c: In function 'scc_pata_prereset':
drivers/ata/pata_scc.c:871: warning: control reaches end of non-void function

On a releated note scc_bus_post_reset() is (AFACT) identical to
ata_bus_post_reset(), would a patch to make ata_bus_post_reset() assesable
to drivers be accepted?

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Acked-by: Tejun Heo <htejun@gmail.com>
Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Tony Breeds and committed by
Jeff Garzik
7e068376 4a05e209

+28 -18
+28 -18
drivers/ata/pata_scc.c
··· 489 * Note: Original code is ata_bus_post_reset(). 490 */ 491 492 - static void scc_bus_post_reset (struct ata_port *ap, unsigned int devmask) 493 { 494 struct ata_ioports *ioaddr = &ap->ioaddr; 495 unsigned int dev0 = devmask & (1 << 0); 496 unsigned int dev1 = devmask & (1 << 1); 497 - unsigned long timeout; 498 499 /* if device 0 was found in ata_devchk, wait for its 500 * BSY bit to clear 501 */ 502 - if (dev0) 503 - ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 504 505 /* if device 1 was found in ata_devchk, wait for 506 * register access, then wait for BSY to clear 507 */ 508 - timeout = jiffies + ATA_TMOUT_BOOT; 509 while (dev1) { 510 u8 nsect, lbal; 511 ··· 517 lbal = in_be32(ioaddr->lbal_addr); 518 if ((nsect == 1) && (lbal == 1)) 519 break; 520 - if (time_after(jiffies, timeout)) { 521 - dev1 = 0; 522 - break; 523 - } 524 msleep(50); /* give drive a breather */ 525 } 526 - if (dev1) 527 - ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); 528 529 /* is all this really necessary? */ 530 ap->ops->dev_select(ap, 0); ··· 533 ap->ops->dev_select(ap, 1); 534 if (dev0) 535 ap->ops->dev_select(ap, 0); 536 } 537 538 /** ··· 543 * Note: Original code is ata_bus_softreset(). 544 */ 545 546 - static unsigned int scc_bus_softreset (struct ata_port *ap, 547 - unsigned int devmask) 548 { 549 struct ata_ioports *ioaddr = &ap->ioaddr; 550 ··· 576 if (scc_check_status(ap) == 0xFF) 577 return 0; 578 579 - scc_bus_post_reset(ap, devmask); 580 581 return 0; 582 } ··· 585 * scc_std_softreset - reset host port via ATA SRST 586 * @ap: port to reset 587 * @classes: resulting classes of attached devices 588 * 589 * Note: Original code is ata_std_softreset(). 590 */ 591 592 - static int scc_std_softreset (struct ata_port *ap, unsigned int *classes) 593 { 594 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; 595 unsigned int devmask = 0, err_mask; ··· 615 616 /* issue bus reset */ 617 DPRINTK("about to softreset, devmask=%x\n", devmask); 618 - err_mask = scc_bus_softreset(ap, devmask); 619 if (err_mask) { 620 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", 621 err_mask); ··· 684 685 if (reg & INTSTS_BMSINT) { 686 unsigned int classes; 687 printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME); 688 out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT); 689 /* TBD: SW reset */ 690 - scc_std_softreset(ap, &classes); 691 continue; 692 } 693 ··· 871 /** 872 * scc_pata_prereset - prepare for reset 873 * @ap: ATA port to be reset 874 */ 875 876 - static int scc_pata_prereset (struct ata_port *ap, unsigned long deadline) 877 { 878 ap->cbl = ATA_CBL_PATA80; 879 return ata_std_prereset(ap, deadline);
··· 489 * Note: Original code is ata_bus_post_reset(). 490 */ 491 492 + static int scc_bus_post_reset(struct ata_port *ap, unsigned int devmask, 493 + unsigned long deadline) 494 { 495 struct ata_ioports *ioaddr = &ap->ioaddr; 496 unsigned int dev0 = devmask & (1 << 0); 497 unsigned int dev1 = devmask & (1 << 1); 498 + int rc; 499 500 /* if device 0 was found in ata_devchk, wait for its 501 * BSY bit to clear 502 */ 503 + if (dev0) { 504 + rc = ata_wait_ready(ap, deadline); 505 + if (rc && rc != -ENODEV) 506 + return rc; 507 + } 508 509 /* if device 1 was found in ata_devchk, wait for 510 * register access, then wait for BSY to clear 511 */ 512 while (dev1) { 513 u8 nsect, lbal; 514 ··· 514 lbal = in_be32(ioaddr->lbal_addr); 515 if ((nsect == 1) && (lbal == 1)) 516 break; 517 + if (time_after(jiffies, deadline)) 518 + return -EBUSY; 519 msleep(50); /* give drive a breather */ 520 } 521 + if (dev1) { 522 + rc = ata_wait_ready(ap, deadline); 523 + if (rc && rc != -ENODEV) 524 + return rc; 525 + } 526 527 /* is all this really necessary? */ 528 ap->ops->dev_select(ap, 0); ··· 529 ap->ops->dev_select(ap, 1); 530 if (dev0) 531 ap->ops->dev_select(ap, 0); 532 + 533 + return 0; 534 } 535 536 /** ··· 537 * Note: Original code is ata_bus_softreset(). 538 */ 539 540 + static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask, 541 + unsigned long deadline) 542 { 543 struct ata_ioports *ioaddr = &ap->ioaddr; 544 ··· 570 if (scc_check_status(ap) == 0xFF) 571 return 0; 572 573 + scc_bus_post_reset(ap, devmask, deadline); 574 575 return 0; 576 } ··· 579 * scc_std_softreset - reset host port via ATA SRST 580 * @ap: port to reset 581 * @classes: resulting classes of attached devices 582 + * @deadline: deadline jiffies for the operation 583 * 584 * Note: Original code is ata_std_softreset(). 585 */ 586 587 + static int scc_std_softreset (struct ata_port *ap, unsigned int *classes, 588 + unsigned long deadline) 589 { 590 unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; 591 unsigned int devmask = 0, err_mask; ··· 607 608 /* issue bus reset */ 609 DPRINTK("about to softreset, devmask=%x\n", devmask); 610 + err_mask = scc_bus_softreset(ap, devmask, deadline); 611 if (err_mask) { 612 ata_port_printk(ap, KERN_ERR, "SRST failed (err_mask=0x%x)\n", 613 err_mask); ··· 676 677 if (reg & INTSTS_BMSINT) { 678 unsigned int classes; 679 + unsigned long deadline = jiffies + ATA_TMOUT_BOOT; 680 printk(KERN_WARNING "%s: Internal Bus Error\n", DRV_NAME); 681 out_be32(bmid_base + SCC_DMA_INTST, INTSTS_BMSINT); 682 /* TBD: SW reset */ 683 + scc_std_softreset(ap, &classes, deadline); 684 continue; 685 } 686 ··· 862 /** 863 * scc_pata_prereset - prepare for reset 864 * @ap: ATA port to be reset 865 + * @deadline: deadline jiffies for the operation 866 */ 867 868 + static int scc_pata_prereset(struct ata_port *ap, unsigned long deadline) 869 { 870 ap->cbl = ATA_CBL_PATA80; 871 return ata_std_prereset(ap, deadline);