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. Signed-off-by: Tejun Heo <htejun@xxxxxxxxx> --- drivers/scsi/libata-core.c | 8 +++++--- drivers/scsi/libata-eh.c | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) b27b1cc97dad12a344d60a184e94dff40c4ed15b diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 8f18ced..9a4124e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -4428,14 +4428,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); @@ -4444,7 +4445,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 71b45ad..7cbb311 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c @@ -806,7 +806,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.3.2 - : 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