mirror of https://github.com/torvalds/linux.git
spi: cavium-thunderx: fix controller deregistration
Make sure to deregister the controller before disabling it to avoid
hanging or leaking resources associated with the queue when the queue
non-empty.
Fixes: 7347a6c7af ("spi: octeon: Add ThunderX driver")
Cc: stable@vger.kernel.org # 4.9
Cc: Jan Glauber <jan.glauber@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260409120419.388546-10-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3c49a4d879
commit
dbb6b01267
|
|
@ -70,7 +70,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
|
|||
|
||||
pci_set_drvdata(pdev, host);
|
||||
|
||||
ret = devm_spi_register_controller(dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
|
|
@ -90,8 +90,14 @@ static void thunderx_spi_remove(struct pci_dev *pdev)
|
|||
if (!p)
|
||||
return;
|
||||
|
||||
spi_controller_get(host);
|
||||
|
||||
spi_unregister_controller(host);
|
||||
|
||||
/* Put everything in a known state. */
|
||||
writeq(0, p->register_base + OCTEON_SPI_CFG(p));
|
||||
|
||||
spi_controller_put(host);
|
||||
}
|
||||
|
||||
static const struct pci_device_id thunderx_spi_pci_id_table[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue