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