mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
This commit is contained in:
parent
3ad6776cca
commit
7616c0ad20
4 changed files with 30 additions and 48 deletions
|
|
@ -1297,4 +1297,26 @@ static inline u8 ide_read_error(ide_drive_t *drive)
|
|||
return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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 ->atapi_input_bytes */
|
||||
while (bcount--)
|
||||
(void)hwif->INB(hwif->io_ports[IDE_DATA_OFFSET]);
|
||||
}
|
||||
|
||||
static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
|
||||
{
|
||||
ide_hwif_t *hwif = drive->hwif;
|
||||
|
||||
/* FIXME: use ->atapi_output_bytes */
|
||||
while (bcount--)
|
||||
hwif->OUTB(0, hwif->io_ports[IDE_DATA_OFFSET]);
|
||||
}
|
||||
|
||||
#endif /* _IDE_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue