Skip to content

Commit 071b38e

Browse files
author
Jiri Kosina
committed
Merge branch 'for-6.15/intel-thc' into for-linus
- removal of deprecated PCI API calls (Philipp Stanner) - code cleanups (Even Xu)
2 parents 7704935 + f97455f commit 071b38e

File tree

5 files changed

+15
-23
lines changed

5 files changed

+15
-23
lines changed

drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -557,28 +557,27 @@ static int quicki2c_probe(struct pci_dev *pdev,
557557

558558
pci_set_master(pdev);
559559

560-
ret = pcim_iomap_regions(pdev, BIT(0), KBUILD_MODNAME);
560+
mem_addr = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
561+
ret = PTR_ERR_OR_ZERO(mem_addr);
561562
if (ret) {
562563
dev_err_once(&pdev->dev, "Failed to get PCI regions, ret = %d.\n", ret);
563564
goto disable_pci_device;
564565
}
565566

566-
mem_addr = pcim_iomap_table(pdev)[0];
567-
568567
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
569568
if (ret) {
570569
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
571570
if (ret) {
572571
dev_err_once(&pdev->dev, "No usable DMA configuration %d\n", ret);
573-
goto unmap_io_region;
572+
goto disable_pci_device;
574573
}
575574
}
576575

577576
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
578577
if (ret < 0) {
579578
dev_err_once(&pdev->dev,
580579
"Failed to allocate IRQ vectors. ret = %d\n", ret);
581-
goto unmap_io_region;
580+
goto disable_pci_device;
582581
}
583582

584583
pdev->irq = pci_irq_vector(pdev, 0);
@@ -587,7 +586,7 @@ static int quicki2c_probe(struct pci_dev *pdev,
587586
if (IS_ERR(qcdev)) {
588587
dev_err_once(&pdev->dev, "QuickI2C device init failed\n");
589588
ret = PTR_ERR(qcdev);
590-
goto unmap_io_region;
589+
goto disable_pci_device;
591590
}
592591

593592
pci_set_drvdata(pdev, qcdev);
@@ -666,8 +665,6 @@ static int quicki2c_probe(struct pci_dev *pdev,
666665
quicki2c_dma_deinit(qcdev);
667666
dev_deinit:
668667
quicki2c_dev_deinit(qcdev);
669-
unmap_io_region:
670-
pcim_iounmap_regions(pdev, BIT(0));
671668
disable_pci_device:
672669
pci_clear_master(pdev);
673670

@@ -697,7 +694,6 @@ static void quicki2c_remove(struct pci_dev *pdev)
697694

698695
quicki2c_dev_deinit(qcdev);
699696

700-
pcim_iounmap_regions(pdev, BIT(0));
701697
pci_clear_master(pdev);
702698
}
703699

drivers/hid/intel-thc-hid/intel-quickspi/pci-quickspi.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static struct quickspi_device *quickspi_dev_init(struct pci_dev *pdev, void __io
426426

427427
thc_interrupt_enable(qsdev->thc_hw, true);
428428

429-
qsdev->state = QUICKSPI_INITED;
429+
qsdev->state = QUICKSPI_INITIATED;
430430

431431
return qsdev;
432432
}
@@ -575,28 +575,27 @@ static int quickspi_probe(struct pci_dev *pdev,
575575

576576
pci_set_master(pdev);
577577

578-
ret = pcim_iomap_regions(pdev, BIT(0), KBUILD_MODNAME);
578+
mem_addr = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
579+
ret = PTR_ERR_OR_ZERO(mem_addr);
579580
if (ret) {
580581
dev_err(&pdev->dev, "Failed to get PCI regions, ret = %d.\n", ret);
581582
goto disable_pci_device;
582583
}
583584

584-
mem_addr = pcim_iomap_table(pdev)[0];
585-
586585
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
587586
if (ret) {
588587
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
589588
if (ret) {
590589
dev_err(&pdev->dev, "No usable DMA configuration %d\n", ret);
591-
goto unmap_io_region;
590+
goto disable_pci_device;
592591
}
593592
}
594593

595594
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
596595
if (ret < 0) {
597596
dev_err(&pdev->dev,
598597
"Failed to allocate IRQ vectors. ret = %d\n", ret);
599-
goto unmap_io_region;
598+
goto disable_pci_device;
600599
}
601600

602601
pdev->irq = pci_irq_vector(pdev, 0);
@@ -605,7 +604,7 @@ static int quickspi_probe(struct pci_dev *pdev,
605604
if (IS_ERR(qsdev)) {
606605
dev_err(&pdev->dev, "QuickSPI device init failed\n");
607606
ret = PTR_ERR(qsdev);
608-
goto unmap_io_region;
607+
goto disable_pci_device;
609608
}
610609

611610
pci_set_drvdata(pdev, qsdev);
@@ -668,8 +667,6 @@ static int quickspi_probe(struct pci_dev *pdev,
668667
quickspi_dma_deinit(qsdev);
669668
dev_deinit:
670669
quickspi_dev_deinit(qsdev);
671-
unmap_io_region:
672-
pcim_iounmap_regions(pdev, BIT(0));
673670
disable_pci_device:
674671
pci_clear_master(pdev);
675672

@@ -699,7 +696,6 @@ static void quickspi_remove(struct pci_dev *pdev)
699696

700697
quickspi_dev_deinit(qsdev);
701698

702-
pcim_iounmap_regions(pdev, BIT(0));
703699
pci_clear_master(pdev);
704700
}
705701

drivers/hid/intel-thc-hid/intel-quickspi/quickspi-dev.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757

5858
enum quickspi_dev_state {
5959
QUICKSPI_NONE,
60+
QUICKSPI_INITIATED,
6061
QUICKSPI_RESETING,
61-
QUICKSPI_RESETED,
62-
QUICKSPI_INITED,
62+
QUICKSPI_RESET,
6363
QUICKSPI_ENABLED,
6464
QUICKSPI_DISABLED,
6565
};

drivers/hid/intel-thc-hid/intel-quickspi/quickspi-protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ int reset_tic(struct quickspi_device *qsdev)
333333
return -EINVAL;
334334
}
335335

336-
qsdev->state = QUICKSPI_RESETED;
336+
qsdev->state = QUICKSPI_RESET;
337337

338338
ret = quickspi_get_device_descriptor(qsdev);
339339
if (ret)

drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static void release_dma_buffers(struct thc_device *dev,
295295
return;
296296

297297
for (i = 0; i < config->prd_tbl_num; i++) {
298-
if (!config->sgls[i] | !config->sgls_nent[i])
298+
if (!config->sgls[i] || !config->sgls_nent[i])
299299
continue;
300300

301301
dma_unmap_sg(dev->dev, config->sgls[i],

0 commit comments

Comments
 (0)