In preparation for SAS attached SATA devices, which will not have a libata scsi_host, only setup host->max_cmd_len if ap->host exists. Signed-off-by: Brian King <brking@xxxxxxxxxx> --- libata-dev-bjking1/drivers/scsi/libata-core.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff -puN drivers/scsi/libata-core.c~libata_cdb_len drivers/scsi/libata-core.c --- libata-dev/drivers/scsi/libata-core.c~libata_cdb_len 2006-06-12 14:11:11.000000000 -0500 +++ libata-dev-bjking1/drivers/scsi/libata-core.c 2006-06-12 14:11:11.000000000 -0500 @@ -1424,11 +1424,13 @@ int ata_dev_configure(struct ata_device cdb_intr_string); } - ap->host->max_cmd_len = 0; - for (i = 0; i < ATA_MAX_DEVICES; i++) - ap->host->max_cmd_len = max_t(unsigned int, - ap->host->max_cmd_len, - ap->device[i].cdb_len); + if (ap->host) { + ap->host->max_cmd_len = 0; + for (i = 0; i < ATA_MAX_DEVICES; i++) + ap->host->max_cmd_len = max_t(unsigned int, + ap->host->max_cmd_len, + ap->device[i].cdb_len); + } /* limit bridge transfers to udma5, 200 sectors */ if (ata_dev_knobble(dev)) { _ - : 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