Skip to content

Commit c133687

Browse files
committed
Merge tag 'spi-fix-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fixes from Mark Brown: "One new device ID, plus a few fixes. The most substantial of the fixes is for the Cadence driver which in at least some instantiations requires transmit data to drive data through the IP" * tag 'spi-fix-v6.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: intel-pci: Add support for Nova Lake SPI serial flash spi: spi-cadence: enable SPI_CONTROLLER_MUST_TX spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization spi: spi-sprd-adi: Fix double free in probe error path
2 parents 346c558 + caa3296 commit c133687

4 files changed

Lines changed: 13 additions & 26 deletions

File tree

drivers/spi/spi-cadence.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ static int cdns_spi_probe(struct platform_device *pdev)
729729
ctlr->unprepare_transfer_hardware = cdns_unprepare_transfer_hardware;
730730
ctlr->mode_bits = SPI_CPOL | SPI_CPHA;
731731
ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
732+
ctlr->flags = SPI_CONTROLLER_MUST_TX;
732733

733734
if (of_device_is_compatible(pdev->dev.of_node, "cix,sky1-spi-r1p6"))
734735
ctlr->bits_per_word_mask |= SPI_BPW_MASK(16) | SPI_BPW_MASK(32);

drivers/spi/spi-hisi-kunpeng.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,8 @@ static const struct debugfs_reg32 hisi_spi_regs[] = {
161161
static int hisi_spi_debugfs_init(struct hisi_spi *hs)
162162
{
163163
char name[32];
164+
struct spi_controller *host = dev_get_drvdata(hs->dev);
164165

165-
struct spi_controller *host;
166-
167-
host = container_of(hs->dev, struct spi_controller, dev);
168166
snprintf(name, 32, "hisi_spi%d", host->bus_num);
169167
hs->debugfs = debugfs_create_dir(name, NULL);
170168
if (IS_ERR(hs->debugfs))

drivers/spi/spi-intel-pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
8181
{ PCI_VDEVICE(INTEL, 0x54a4), (unsigned long)&cnl_info },
8282
{ PCI_VDEVICE(INTEL, 0x5794), (unsigned long)&cnl_info },
8383
{ PCI_VDEVICE(INTEL, 0x5825), (unsigned long)&cnl_info },
84+
{ PCI_VDEVICE(INTEL, 0x6e24), (unsigned long)&cnl_info },
8485
{ PCI_VDEVICE(INTEL, 0x7723), (unsigned long)&cnl_info },
8586
{ PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
8687
{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },

drivers/spi/spi-sprd-adi.c

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -528,18 +528,16 @@ static int sprd_adi_probe(struct platform_device *pdev)
528528
pdev->id = of_alias_get_id(np, "spi");
529529
num_chipselect = of_get_child_count(np);
530530

531-
ctlr = spi_alloc_host(&pdev->dev, sizeof(struct sprd_adi));
531+
ctlr = devm_spi_alloc_host(&pdev->dev, sizeof(struct sprd_adi));
532532
if (!ctlr)
533533
return -ENOMEM;
534534

535535
dev_set_drvdata(&pdev->dev, ctlr);
536536
sadi = spi_controller_get_devdata(ctlr);
537537

538538
sadi->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
539-
if (IS_ERR(sadi->base)) {
540-
ret = PTR_ERR(sadi->base);
541-
goto put_ctlr;
542-
}
539+
if (IS_ERR(sadi->base))
540+
return PTR_ERR(sadi->base);
543541

544542
sadi->slave_vbase = (unsigned long)sadi->base +
545543
data->slave_offset;
@@ -551,18 +549,15 @@ static int sprd_adi_probe(struct platform_device *pdev)
551549
if (ret > 0 || (IS_ENABLED(CONFIG_HWSPINLOCK) && ret == 0)) {
552550
sadi->hwlock =
553551
devm_hwspin_lock_request_specific(&pdev->dev, ret);
554-
if (!sadi->hwlock) {
555-
ret = -ENXIO;
556-
goto put_ctlr;
557-
}
552+
if (!sadi->hwlock)
553+
return -ENXIO;
558554
} else {
559555
switch (ret) {
560556
case -ENOENT:
561557
dev_info(&pdev->dev, "no hardware spinlock supplied\n");
562558
break;
563559
default:
564-
dev_err_probe(&pdev->dev, ret, "failed to find hwlock id\n");
565-
goto put_ctlr;
560+
return dev_err_probe(&pdev->dev, ret, "failed to find hwlock id\n");
566561
}
567562
}
568563

@@ -579,26 +574,18 @@ static int sprd_adi_probe(struct platform_device *pdev)
579574
ctlr->transfer_one = sprd_adi_transfer_one;
580575

581576
ret = devm_spi_register_controller(&pdev->dev, ctlr);
582-
if (ret) {
583-
dev_err(&pdev->dev, "failed to register SPI controller\n");
584-
goto put_ctlr;
585-
}
577+
if (ret)
578+
return dev_err_probe(&pdev->dev, ret, "failed to register SPI controller\n");
586579

587580
if (sadi->data->restart) {
588581
ret = devm_register_restart_handler(&pdev->dev,
589582
sadi->data->restart,
590583
sadi);
591-
if (ret) {
592-
dev_err(&pdev->dev, "can not register restart handler\n");
593-
goto put_ctlr;
594-
}
584+
if (ret)
585+
return dev_err_probe(&pdev->dev, ret, "can not register restart handler\n");
595586
}
596587

597588
return 0;
598-
599-
put_ctlr:
600-
spi_controller_put(ctlr);
601-
return ret;
602589
}
603590

604591
static struct sprd_adi_data sc9860_data = {

0 commit comments

Comments
 (0)