Skip to content

Commit d5b560c

Browse files
Sergey ShtylyovDamien Le Moal
authored andcommitted
ata: libata-sff: kill unused ata_sff_busy_sleep()
Nobody seems to call ata_sff_busy_sleep(), so we can get rid of it... Signed-off-by: Sergey Shtylyov <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent de58fd3 commit d5b560c

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

drivers/ata/libata-sff.c

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -184,62 +184,6 @@ void ata_sff_dma_pause(struct ata_port *ap)
184184
}
185185
EXPORT_SYMBOL_GPL(ata_sff_dma_pause);
186186

187-
/**
188-
* ata_sff_busy_sleep - sleep until BSY clears, or timeout
189-
* @ap: port containing status register to be polled
190-
* @tmout_pat: impatience timeout in msecs
191-
* @tmout: overall timeout in msecs
192-
*
193-
* Sleep until ATA Status register bit BSY clears,
194-
* or a timeout occurs.
195-
*
196-
* LOCKING:
197-
* Kernel thread context (may sleep).
198-
*
199-
* RETURNS:
200-
* 0 on success, -errno otherwise.
201-
*/
202-
int ata_sff_busy_sleep(struct ata_port *ap,
203-
unsigned long tmout_pat, unsigned long tmout)
204-
{
205-
unsigned long timer_start, timeout;
206-
u8 status;
207-
208-
status = ata_sff_busy_wait(ap, ATA_BUSY, 300);
209-
timer_start = jiffies;
210-
timeout = ata_deadline(timer_start, tmout_pat);
211-
while (status != 0xff && (status & ATA_BUSY) &&
212-
time_before(jiffies, timeout)) {
213-
ata_msleep(ap, 50);
214-
status = ata_sff_busy_wait(ap, ATA_BUSY, 3);
215-
}
216-
217-
if (status != 0xff && (status & ATA_BUSY))
218-
ata_port_warn(ap,
219-
"port is slow to respond, please be patient (Status 0x%x)\n",
220-
status);
221-
222-
timeout = ata_deadline(timer_start, tmout);
223-
while (status != 0xff && (status & ATA_BUSY) &&
224-
time_before(jiffies, timeout)) {
225-
ata_msleep(ap, 50);
226-
status = ap->ops->sff_check_status(ap);
227-
}
228-
229-
if (status == 0xff)
230-
return -ENODEV;
231-
232-
if (status & ATA_BUSY) {
233-
ata_port_err(ap,
234-
"port failed to respond (%lu secs, Status 0x%x)\n",
235-
DIV_ROUND_UP(tmout, 1000), status);
236-
return -EBUSY;
237-
}
238-
239-
return 0;
240-
}
241-
EXPORT_SYMBOL_GPL(ata_sff_busy_sleep);
242-
243187
static int ata_sff_check_ready(struct ata_link *link)
244188
{
245189
u8 status = link->ap->ops->sff_check_status(link->ap);

include/linux/libata.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,8 +1918,6 @@ extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
19181918
extern u8 ata_sff_check_status(struct ata_port *ap);
19191919
extern void ata_sff_pause(struct ata_port *ap);
19201920
extern void ata_sff_dma_pause(struct ata_port *ap);
1921-
extern int ata_sff_busy_sleep(struct ata_port *ap,
1922-
unsigned long timeout_pat, unsigned long timeout);
19231921
extern int ata_sff_wait_ready(struct ata_link *link, unsigned long deadline);
19241922
extern void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
19251923
extern void ata_sff_tf_read(struct ata_port *ap, struct ata_taskfile *tf);

0 commit comments

Comments
 (0)