Skip to content

Commit 3cfedd5

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: sata_nv: Switch to using ->device_configure
Switch to the ->device_configure method instead of ->slave_configure and update the block limits on the passed in queue_limits instead of using the per-limit accessors. Signed-off-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hannes Reinecke <[email protected]> Acked-by: Damien Le Moal <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 70a7949 commit 3cfedd5

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

drivers/ata/sata_nv.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ static void nv_nf2_freeze(struct ata_port *ap);
296296
static void nv_nf2_thaw(struct ata_port *ap);
297297
static void nv_ck804_freeze(struct ata_port *ap);
298298
static void nv_ck804_thaw(struct ata_port *ap);
299-
static int nv_adma_slave_config(struct scsi_device *sdev);
299+
static int nv_adma_device_configure(struct scsi_device *sdev,
300+
struct queue_limits *lim);
300301
static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc);
301302
static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc);
302303
static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc);
@@ -318,7 +319,8 @@ static void nv_adma_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
318319
static void nv_mcp55_thaw(struct ata_port *ap);
319320
static void nv_mcp55_freeze(struct ata_port *ap);
320321
static void nv_swncq_error_handler(struct ata_port *ap);
321-
static int nv_swncq_slave_config(struct scsi_device *sdev);
322+
static int nv_swncq_device_configure(struct scsi_device *sdev,
323+
struct queue_limits *lim);
322324
static int nv_swncq_port_start(struct ata_port *ap);
323325
static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc);
324326
static void nv_swncq_fill_sg(struct ata_queued_cmd *qc);
@@ -380,7 +382,7 @@ static const struct scsi_host_template nv_adma_sht = {
380382
.can_queue = NV_ADMA_MAX_CPBS,
381383
.sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN,
382384
.dma_boundary = NV_ADMA_DMA_BOUNDARY,
383-
.slave_configure = nv_adma_slave_config,
385+
.device_configure = nv_adma_device_configure,
384386
.sdev_groups = ata_ncq_sdev_groups,
385387
.change_queue_depth = ata_scsi_change_queue_depth,
386388
.tag_alloc_policy = BLK_TAG_ALLOC_RR,
@@ -391,7 +393,7 @@ static const struct scsi_host_template nv_swncq_sht = {
391393
.can_queue = ATA_MAX_QUEUE - 1,
392394
.sg_tablesize = LIBATA_MAX_PRD,
393395
.dma_boundary = ATA_DMA_BOUNDARY,
394-
.slave_configure = nv_swncq_slave_config,
396+
.device_configure = nv_swncq_device_configure,
395397
.sdev_groups = ata_ncq_sdev_groups,
396398
.change_queue_depth = ata_scsi_change_queue_depth,
397399
.tag_alloc_policy = BLK_TAG_ALLOC_RR,
@@ -661,7 +663,8 @@ static void nv_adma_mode(struct ata_port *ap)
661663
pp->flags &= ~NV_ADMA_PORT_REGISTER_MODE;
662664
}
663665

664-
static int nv_adma_slave_config(struct scsi_device *sdev)
666+
static int nv_adma_device_configure(struct scsi_device *sdev,
667+
struct queue_limits *lim)
665668
{
666669
struct ata_port *ap = ata_shost_to_port(sdev->host);
667670
struct nv_adma_port_priv *pp = ap->private_data;
@@ -740,8 +743,8 @@ static int nv_adma_slave_config(struct scsi_device *sdev)
740743
rc = dma_set_mask(&pdev->dev, pp->adma_dma_mask);
741744
}
742745

743-
blk_queue_segment_boundary(sdev->request_queue, segment_boundary);
744-
blk_queue_max_segments(sdev->request_queue, sg_tablesize);
746+
lim->seg_boundary_mask = segment_boundary;
747+
lim->max_segments = sg_tablesize;
745748
ata_port_info(ap,
746749
"DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n",
747750
(unsigned long long)*ap->host->dev->dma_mask,
@@ -1868,7 +1871,8 @@ static void nv_swncq_host_init(struct ata_host *host)
18681871
writel(~0x0, mmio + NV_INT_STATUS_MCP55);
18691872
}
18701873

1871-
static int nv_swncq_slave_config(struct scsi_device *sdev)
1874+
static int nv_swncq_device_configure(struct scsi_device *sdev,
1875+
struct queue_limits *lim)
18721876
{
18731877
struct ata_port *ap = ata_shost_to_port(sdev->host);
18741878
struct pci_dev *pdev = to_pci_dev(ap->host->dev);

0 commit comments

Comments
 (0)