Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b65fac32 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 5b31f855
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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;

@@ -310,7 +310,7 @@ 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);
+1 −1
Original line number Diff line number Diff line
@@ -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))
+4 −4
Original line number Diff line number Diff line
@@ -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]);
@@ -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;
@@ -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;
@@ -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;

+7 −9
Original line number Diff line number Diff line
@@ -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, "
@@ -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 */
@@ -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
@@ -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);
@@ -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;

@@ -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;
@@ -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;
Loading