Not all controllers have single TF image and ops->tf_read() is inappropriate for them. Newly implemented hotplug probing will allow drivers for such controllers to get rid of ops->tf_read() completely. Make ops->tf_read() optional in core layer. --- drivers/scsi/libata-core.c | 8 +++++--- drivers/scsi/libata-eh.c | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) 164a958101ccf3f82b1af1be7dd77d991cd88d65 diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 636f044..6d86479 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -4429,14 +4429,15 @@ void ata_qc_complete(struct ata_queued_c if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { if (!ata_tag_internal(qc->tag)) { /* always fill result TF for failed qc */ - ap->ops->tf_read(ap, &qc->result_tf); + if (ap->ops->tf_read) + ap->ops->tf_read(ap, &qc->result_tf); ata_qc_schedule_eh(qc); return; } } /* read result TF if requested */ - if (qc->flags & ATA_QCFLAG_RESULT_TF) + if (ap->ops->tf_read && qc->flags & ATA_QCFLAG_RESULT_TF) ap->ops->tf_read(ap, &qc->result_tf); __ata_qc_complete(qc); @@ -4445,7 +4446,8 @@ void ata_qc_complete(struct ata_queued_c return; /* read result TF if failed or requested */ - if (qc->err_mask || qc->flags & ATA_QCFLAG_RESULT_TF) + if (ap->ops->tf_read && + (qc->err_mask || qc->flags & ATA_QCFLAG_RESULT_TF)) ap->ops->tf_read(ap, &qc->result_tf); __ata_qc_complete(qc); diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index b6268b5..740934b 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c @@ -811,7 +811,8 @@ static unsigned int atapi_eh_request_sen memset(sense_buf, 0, SCSI_SENSE_BUFFERSIZE); /* XXX: why tf_read here? */ - ap->ops->tf_read(ap, &tf); + if (ap->ops->tf_read) + ap->ops->tf_read(ap, &tf); /* fill these in, for the case where they are -not- overwritten */ sense_buf[0] = 0x70; -- 1.2.4 - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html