mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 13:09:04 -04:00
ide: add ide_pad_transfer() helper
* Add ide_pad_transfer() helper (which uses ->{in,out}put_data methods
internally so the transfer is also padded to drive+host requirements)
and use it instead of ide_atapi_{write_zeros,discard_data}().
* Remove no longer needed ide_atapi_{write_zeros,discard_data}().
Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
7c0daf2681
commit
9f87abe892
5 changed files with 24 additions and 33 deletions
|
|
@ -827,6 +827,8 @@ void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int,
|
|||
|
||||
void ide_execute_pkt_cmd(ide_drive_t *);
|
||||
|
||||
void ide_pad_transfer(ide_drive_t *, int, int);
|
||||
|
||||
ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
|
||||
|
||||
ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
|
||||
|
|
@ -1359,27 +1361,4 @@ static inline u8 ide_read_error(ide_drive_t *drive)
|
|||
|
||||
return hwif->INB(hwif->io_ports.error_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Too bad. The drive wants to send us data which we are not ready to accept.
|
||||
* Just throw it away.
|
||||
*/
|
||||
static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
/* FIXME: use ->input_data */
|
||||
while (bcount--)
|
||||
(void)hwif->INB(hwif->io_ports.data_addr);
|
||||
}
|
||||
|
||||
static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
/* FIXME: use ->output_data */
|
||||
while (bcount--)
|
||||
hwif->OUTB(0, hwif->io_ports.data_addr);
|
||||
}
|
||||
|
||||
#endif /* _IDE_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue