Skip to content

Commit

Permalink
pata_scc: propagate return value of scc_wait_after_reset
Browse files Browse the repository at this point in the history
scc_bus_softreset not necessarily should return zero.
Propagate the error code.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Arjun Sreedharan authored and Tejun Heo committed Aug 18, 2014
1 parent 0e57407 commit 4dc7c76
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/ata/pata_scc.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,
* Note: Original code is ata_bus_softreset().
*/

static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
static int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
unsigned long deadline)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
Expand All @@ -599,9 +599,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
udelay(20);
out_be32(ioaddr->ctl_addr, ap->ctl);

scc_wait_after_reset(&ap->link, devmask, deadline);

return 0;
return scc_wait_after_reset(&ap->link, devmask, deadline);
}

/**
Expand All @@ -618,7 +616,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
{
struct ata_port *ap = link->ap;
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 0, err_mask;
unsigned int devmask = 0;
int rc;
u8 err;

DPRINTK("ENTER\n");
Expand All @@ -634,9 +633,9 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,

/* issue bus reset */
DPRINTK("about to softreset, devmask=%x\n", devmask);
err_mask = scc_bus_softreset(ap, devmask, deadline);
if (err_mask) {
ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask);
rc = scc_bus_softreset(ap, devmask, deadline);
if (rc) {
ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", rc);
return -EIO;
}

Expand Down

0 comments on commit 4dc7c76

Please sign in to comment.