Commit db83744a authored by Arjun Sreedharan's avatar Arjun Sreedharan Committed by Zefan Li

pata_scc: propagate return value of scc_wait_after_reset

commit 4dc7c76c upstream.

scc_bus_softreset not necessarily should return zero.
Propagate the error code.
Signed-off-by: default avatarArjun Sreedharan <arjun024@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarZefan Li <lizefan@huawei.com>
parent f0634a3e
...@@ -586,7 +586,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask, ...@@ -586,7 +586,7 @@ static int scc_wait_after_reset(struct ata_link *link, unsigned int devmask,
* Note: Original code is ata_bus_softreset(). * 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) unsigned long deadline)
{ {
struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr;
...@@ -600,9 +600,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask, ...@@ -600,9 +600,7 @@ static unsigned int scc_bus_softreset(struct ata_port *ap, unsigned int devmask,
udelay(20); udelay(20);
out_be32(ioaddr->ctl_addr, ap->ctl); out_be32(ioaddr->ctl_addr, ap->ctl);
scc_wait_after_reset(&ap->link, devmask, deadline); return scc_wait_after_reset(&ap->link, devmask, deadline);
return 0;
} }
/** /**
...@@ -619,7 +617,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, ...@@ -619,7 +617,8 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
{ {
struct ata_port *ap = link->ap; struct ata_port *ap = link->ap;
unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS;
unsigned int devmask = 0, err_mask; unsigned int devmask = 0;
int rc;
u8 err; u8 err;
DPRINTK("ENTER\n"); DPRINTK("ENTER\n");
...@@ -635,9 +634,9 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes, ...@@ -635,9 +634,9 @@ static int scc_softreset(struct ata_link *link, unsigned int *classes,
/* issue bus reset */ /* issue bus reset */
DPRINTK("about to softreset, devmask=%x\n", devmask); DPRINTK("about to softreset, devmask=%x\n", devmask);
err_mask = scc_bus_softreset(ap, devmask, deadline); rc = scc_bus_softreset(ap, devmask, deadline);
if (err_mask) { if (rc) {
ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", err_mask); ata_port_err(ap, "SRST failed (err_mask=0x%x)\n", rc);
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment