Skip to content

Commit b65fac3

Browse files
committed
ide: merge ide_hwgroup_t with ide_hwif_t (v2)
* 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 <bzolnier@gmail.com>
1 parent 5b31f85 commit b65fac3

26 files changed

Lines changed: 188 additions & 266 deletions

‎drivers/ide/alim15x3.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static void ali_set_dma_mode(ide_drive_t *drive, const u8 speed)
198198
static int ali15x3_dma_setup(ide_drive_t *drive)
199199
{
200200
if (m5229_revision < 0xC2 && drive->media != ide_disk) {
201-
if (rq_data_dir(drive->hwif->hwgroup->rq))
201+
if (rq_data_dir(drive->hwif->rq))
202202
return 1; /* try PIO instead of DMA */
203203
}
204204
return ide_dma_setup(drive);

‎drivers/ide/au1xxx-ide.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int auide_build_dmatable(ide_drive_t *drive)
213213
{
214214
int i, iswrite, count = 0;
215215
ide_hwif_t *hwif = HWIF(drive);
216-
struct request *rq = HWGROUP(drive)->rq;
216+
struct request *rq = hwif->rq;
217217
_auide_hwif *ahwif = &auide_hwif;
218218
struct scatterlist *sg;
219219

@@ -309,8 +309,8 @@ static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command)
309309
}
310310

311311
static int auide_dma_setup(ide_drive_t *drive)
312-
{
313-
struct request *rq = HWGROUP(drive)->rq;
312+
{
313+
struct request *rq = drive->hwif->rq;
314314

315315
if (!auide_build_dmatable(drive)) {
316316
ide_map_sg(drive, rq);

‎drivers/ide/icside.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static int icside_dma_setup(ide_drive_t *drive)
312312
ide_hwif_t *hwif = HWIF(drive);
313313
struct expansion_card *ec = ECARD_DEV(hwif->dev);
314314
struct icside_state *state = ecard_get_drvdata(ec);
315-
struct request *rq = hwif->hwgroup->rq;
315+
struct request *rq = hwif->rq;
316316
unsigned int dma_mode;
317317

318318
if (rq_data_dir(rq))

‎drivers/ide/ide-atapi.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ EXPORT_SYMBOL_GPL(ide_retry_pc);
243243

244244
int ide_cd_expiry(ide_drive_t *drive)
245245
{
246-
struct request *rq = HWGROUP(drive)->rq;
246+
struct request *rq = drive->hwif->rq;
247247
unsigned long wait = 0;
248248

249249
debug_log("%s: rq->cmd[0]: 0x%x\n", __func__, rq->cmd[0]);
@@ -294,7 +294,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
294294
{
295295
struct ide_atapi_pc *pc = drive->pc;
296296
ide_hwif_t *hwif = drive->hwif;
297-
struct request *rq = hwif->hwgroup->rq;
297+
struct request *rq = hwif->rq;
298298
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
299299
xfer_func_t *xferfunc;
300300
unsigned int timeout, temp;
@@ -491,7 +491,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
491491
{
492492
struct ide_atapi_pc *uninitialized_var(pc);
493493
ide_hwif_t *hwif = drive->hwif;
494-
struct request *rq = hwif->hwgroup->rq;
494+
struct request *rq = hwif->rq;
495495
ide_expiry_t *expiry;
496496
unsigned int timeout;
497497
int cmd_len;
@@ -580,7 +580,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive)
580580

581581
if (dev_is_idecd(drive)) {
582582
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
583-
bcount = ide_cd_get_xferlen(hwif->hwgroup->rq);
583+
bcount = ide_cd_get_xferlen(hwif->rq);
584584
expiry = ide_cd_expiry;
585585
timeout = ATAPI_WAIT_PC;
586586

‎drivers/ide/ide-cd.c‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense,
239239

240240
static void cdrom_end_request(ide_drive_t *drive, int uptodate)
241241
{
242-
struct request *rq = HWGROUP(drive)->rq;
242+
struct request *rq = drive->hwif->rq;
243243
int nsectors = rq->hard_cur_sectors;
244244

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

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

505-
hwgroup->rq = NULL;
504+
hwif->rq = NULL;
506505

507506
cdrom_queue_request_sense(drive, rq->sense, rq);
508507
} else
@@ -525,7 +524,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *);
525524
static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive)
526525
{
527526
ide_hwif_t *hwif = drive->hwif;
528-
struct request *rq = hwif->hwgroup->rq;
527+
struct request *rq = hwif->rq;
529528
int xferlen;
530529

531530
xferlen = ide_cd_get_xferlen(rq);
@@ -567,7 +566,7 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive)
567566
static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive)
568567
{
569568
ide_hwif_t *hwif = drive->hwif;
570-
struct request *rq = hwif->hwgroup->rq;
569+
struct request *rq = hwif->rq;
571570
int cmd_len;
572571
ide_startstop_t startstop;
573572

@@ -854,8 +853,7 @@ static int cdrom_newpc_intr_dummy_cb(struct request *rq)
854853
static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
855854
{
856855
ide_hwif_t *hwif = drive->hwif;
857-
ide_hwgroup_t *hwgroup = hwif->hwgroup;
858-
struct request *rq = hwgroup->rq;
856+
struct request *rq = hwif->rq;
859857
xfer_func_t *xferfunc;
860858
ide_expiry_t *expiry = NULL;
861859
int dma_error = 0, dma, stat, thislen, uptodate = 0;
@@ -1061,7 +1059,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
10611059
if (blk_end_request(rq, 0, dlen))
10621060
BUG();
10631061

1064-
hwgroup->rq = NULL;
1062+
hwif->rq = NULL;
10651063
} else {
10661064
if (!uptodate)
10671065
rq->cmd_flags |= REQ_FAILED;

‎drivers/ide/ide-dma-sff.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ EXPORT_SYMBOL_GPL(ide_build_dmatable);
175175
int ide_dma_setup(ide_drive_t *drive)
176176
{
177177
ide_hwif_t *hwif = drive->hwif;
178-
struct request *rq = hwif->hwgroup->rq;
178+
struct request *rq = hwif->rq;
179179
unsigned int reading = rq_data_dir(rq) ? 0 : ATA_DMA_WR;
180180
u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0;
181181
u8 dma_stat;
@@ -240,7 +240,7 @@ static int dma_timer_expiry(ide_drive_t *drive)
240240
if ((dma_stat & 0x18) == 0x18) /* BUSY Stupid Early Timer !! */
241241
return WAIT_CMD;
242242

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

245245
if (dma_stat & ATA_DMA_ERR) /* ERROR */
246246
return -1;

‎drivers/ide/ide-dma.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *drive)
9696

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

101101
task_end_request(drive, rq, stat);
102102
return ide_stopped;

‎drivers/ide/ide-floppy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
static int ide_floppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
7272
{
7373
struct ide_disk_obj *floppy = drive->driver_data;
74-
struct request *rq = HWGROUP(drive)->rq;
74+
struct request *rq = drive->hwif->rq;
7575
int error;
7676

7777
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);

0 commit comments

Comments
 (0)