This commit is contained in:
Mark Brown 2021-04-15 19:29:40 +01:00
commit c7ed5fd5fb
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 12 additions and 8 deletions

View File

@ -31,6 +31,7 @@ properties:
- mediatek,mt7623-nor
- mediatek,mt7629-nor
- mediatek,mt8192-nor
- mediatek,mt8195-nor
- enum:
- mediatek,mt8173-nor
- items:

View File

@ -1496,6 +1496,10 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = {
{ PCI_VDEVICE(INTEL, 0x51aa), LPSS_CNL_SSP },
{ PCI_VDEVICE(INTEL, 0x51ab), LPSS_CNL_SSP },
{ PCI_VDEVICE(INTEL, 0x51fb), LPSS_CNL_SSP },
/* ADL-M */
{ PCI_VDEVICE(INTEL, 0x54aa), LPSS_CNL_SSP },
{ PCI_VDEVICE(INTEL, 0x54ab), LPSS_CNL_SSP },
{ PCI_VDEVICE(INTEL, 0x54fb), LPSS_CNL_SSP },
/* APL */
{ PCI_VDEVICE(INTEL, 0x5ac2), LPSS_BXT_SSP },
{ PCI_VDEVICE(INTEL, 0x5ac4), LPSS_BXT_SSP },

View File

@ -1927,7 +1927,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
ret = devm_spi_register_master(&pdev->dev, master);
ret = spi_register_master(master);
if (ret) {
dev_err(&pdev->dev, "spi master registration failed: %d\n",
ret);
@ -1956,6 +1956,7 @@ static int stm32_spi_remove(struct platform_device *pdev)
struct spi_master *master = platform_get_drvdata(pdev);
struct stm32_spi *spi = spi_master_get_devdata(master);
spi_unregister_master(master);
spi->cfg->disable(spi);
if (master->dma_tx)

View File

@ -2487,6 +2487,7 @@ struct spi_controller *__devm_spi_alloc_controller(struct device *dev,
ctlr = __spi_alloc_controller(dev, size, slave);
if (ctlr) {
ctlr->devm_allocated = true;
*ptr = ctlr;
devres_add(dev, ptr);
} else {
@ -2824,11 +2825,6 @@ int devm_spi_register_controller(struct device *dev,
}
EXPORT_SYMBOL_GPL(devm_spi_register_controller);
static int devm_spi_match_controller(struct device *dev, void *res, void *ctlr)
{
return *(struct spi_controller **)res == ctlr;
}
static int __unregister(struct device *dev, void *null)
{
spi_unregister_device(to_spi_device(dev));
@ -2875,8 +2871,7 @@ void spi_unregister_controller(struct spi_controller *ctlr)
/* Release the last reference on the controller if its driver
* has not yet been converted to devm_spi_alloc_master/slave().
*/
if (!devres_find(ctlr->dev.parent, devm_spi_release_controller,
devm_spi_match_controller, ctlr))
if (!ctlr->devm_allocated)
put_device(&ctlr->dev);
/* free bus id */

View File

@ -509,6 +509,9 @@ struct spi_controller {
#define SPI_MASTER_GPIO_SS BIT(5) /* GPIO CS must select slave */
/* flag indicating this is a non-devres managed controller */
bool devm_allocated;
/* flag indicating this is an SPI slave controller */
bool slave;