Skip to content

Commit

Permalink
ide: merge ide_hwgroup_t with ide_hwif_t (v2)
Browse files Browse the repository at this point in the history
* Merge ide_hwgroup_t with ide_hwif_t.

* Cleanup init_irq() accordingly, then remove no longer needed
  ide_remove_port_from_hwgroup() and ide_ports[].

* Remove now unused HWGROUP() macro.

While at it:

* ide_dump_ata_error() fixups

v2:
* Fix ->quirk_list check in do_ide_request()
  (s/hwif->cur_dev/prev_port->cur_dev).

Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
  • Loading branch information
bzolnier committed Jan 6, 2009
1 parent 5b31f85 commit b65fac3
Show file tree
Hide file tree
Showing 26 changed files with 188 additions and 266 deletions.
2 changes: 1 addition & 1 deletion drivers/ide/alim15x3.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed)
static int ali15x3_dma_setup(ide_drive_t *drive)
{
if (m5229_revision < 0xC2 && drive->media != ide_disk) {
if (rq_data_dir(drive->hwif->hwgroup->rq))
if (rq_data_dir(drive->hwif->rq))
return 1; /* try PIO instead of DMA */
}
return ide_dma_setup(drive);
Expand Down
6 changes: 3 additions & 3 deletions drivers/ide/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
{
int i, iswrite, count = 0;
ide_hwif_t *hwif = HWIF(drive);
struct request *rq = HWGROUP(drive)->rq;
struct request *rq = hwif->rq;
_auide_hwif *ahwif = &auide_hwif;
struct scatterlist *sg;

Expand Down Expand Up @@ -309,8 +309,8 @@ static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command)
}

static int auide_dma_setup(ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
{
struct request *rq = drive->hwif->rq;

if (!auide_build_dmatable(drive)) {
ide_map_sg(drive, rq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static int icside_dma_setup(ide_drive_t *drive)
ide_hwif_t *hwif = HWIF(drive);
struct expansion_card *ec = ECARD_DEV(hwif->dev);
struct icside_state *state = ecard_get_drvdata(ec);
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
unsigned int dma_mode;

if (rq_data_dir(rq))
Expand Down
8 changes: 4 additions & 4 deletions drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ EXPORT_SYMBOL_GPL(ide_retry_pc);

int ide_cd_expiry(ide_drive_t *drive)
{
struct request *rq = HWGROUP(drive)->rq;
struct request *rq = drive->hwif->rq;
unsigned long wait = 0;

debug_log("%s: rq->cmd[0]: 0x%x\n", __func__, rq->cmd[0]);
Expand Down Expand Up @@ -294,7 +294,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
{
struct ide_atapi_pc *pc = drive->pc;
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
xfer_func_t *xferfunc;
unsigned int timeout, temp;
Expand Down Expand Up @@ -491,7 +491,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
{
struct ide_atapi_pc *uninitialized_var(pc);
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
ide_expiry_t *expiry;
unsigned int timeout;
int cmd_len;
Expand Down Expand Up @@ -580,7 +580,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive)

if (dev_is_idecd(drive)) {
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
bcount = ide_cd_get_xferlen(hwif->hwgroup->rq);
bcount = ide_cd_get_xferlen(hwif->rq);
expiry = ide_cd_expiry;
timeout = ATAPI_WAIT_PC;

Expand Down
16 changes: 7 additions & 9 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,

static void cdrom_end_request(ide_drive_t *drive, int uptodate)
{
struct request *rq = HWGROUP(drive)->rq;
struct request *rq = drive->hwif->rq;
int nsectors = rq->hard_cur_sectors;

ide_debug_log(IDE_DBG_FUNC, "Call %s, cmd: 0x%x, uptodate: 0x%x, "
Expand Down Expand Up @@ -306,8 +306,7 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st)
static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
{
ide_hwif_t *hwif = drive->hwif;
ide_hwgroup_t *hwgroup = hwif->hwgroup;
struct request *rq = hwgroup->rq;
struct request *rq = hwif->rq;
int stat, err, sense_key;

/* check for errors */
Expand Down Expand Up @@ -502,7 +501,7 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret)
blkdev_dequeue_request(rq);
spin_unlock_irqrestore(q->queue_lock, flags);

hwgroup->rq = NULL;
hwif->rq = NULL;

cdrom_queue_request_sense(drive, rq->sense, rq);
} else
Expand All @@ -525,7 +524,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *);
static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
int xferlen;

xferlen = ide_cd_get_xferlen(rq);
Expand Down Expand Up @@ -567,7 +566,7 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive)
static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
int cmd_len;
ide_startstop_t startstop;

Expand Down Expand Up @@ -854,8 +853,7 @@ static int cdrom_newpc_intr_dummy_cb(struct request *rq)
static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
ide_hwgroup_t *hwgroup = hwif->hwgroup;
struct request *rq = hwgroup->rq;
struct request *rq = hwif->rq;
xfer_func_t *xferfunc;
ide_expiry_t *expiry = NULL;
int dma_error = 0, dma, stat, thislen, uptodate = 0;
Expand Down Expand Up @@ -1061,7 +1059,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
if (blk_end_request(rq, 0, dlen))
BUG();

hwgroup->rq = NULL;
hwif->rq = NULL;
} else {
if (!uptodate)
rq->cmd_flags |= REQ_FAILED;
Expand Down
4 changes: 2 additions & 2 deletions drivers/ide/ide-dma-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ EXPORT_SYMBOL_GPL(ide_build_dmatable);
int ide_dma_setup(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;
unsigned int reading = rq_data_dir(rq) ? 0 : ATA_DMA_WR;
u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
u8 dma_stat;
Expand Down Expand Up @@ -240,7 +240,7 @@ static int dma_timer_expiry(ide_drive_t *drive)
if ((dma_stat & 0x18) == 0x18) /* BUSY Stupid Early Timer !! */
return WAIT_CMD;

hwif->hwgroup->expiry = NULL; /* one free ride for now */
hwif->expiry = NULL; /* one free ride for now */

if (dma_stat & ATA_DMA_ERR) /* ERROR */
return -1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *drive)

if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
if (!dma_stat) {
struct request *rq = hwif->hwgroup->rq;
struct request *rq = hwif->rq;

task_end_request(drive, rq, stat);
return ide_stopped;
Expand Down
2 changes: 1 addition & 1 deletion drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
{
struct ide_disk_obj *floppy = drive->driver_data;
struct request *rq = HWGROUP(drive)->rq;
struct request *rq = drive->hwif->rq;
int error;

ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
Expand Down
Loading

0 comments on commit b65fac3

Please sign in to comment.