Skip to content

Commit

Permalink
spi: qup: Convert to platform remove callback
Browse files Browse the repository at this point in the history
Merge series from Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:

After fixing the error handling in the .remove() callback of the qup
driver, convert it to .remove_new() preparing to make platform driver's
remove functions return void.
  • Loading branch information
Mark Brown committed Apr 4, 2023
2 parents 69d286c + dea8e70 commit 43bac51
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions drivers/spi/spi-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1270,29 +1270,31 @@ static int spi_qup_resume(struct device *device)
}
#endif /* CONFIG_PM_SLEEP */

static int spi_qup_remove(struct platform_device *pdev)
static void spi_qup_remove(struct platform_device *pdev)
{
struct spi_master *master = dev_get_drvdata(&pdev->dev);
struct spi_qup *controller = spi_master_get_devdata(master);
int ret;

ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0)
return ret;
ret = pm_runtime_get_sync(&pdev->dev);

ret = spi_qup_set_state(controller, QUP_STATE_RESET);
if (ret)
return ret;
if (ret >= 0) {
ret = spi_qup_set_state(controller, QUP_STATE_RESET);
if (ret)
dev_warn(&pdev->dev, "failed to reset controller (%pe)\n",
ERR_PTR(ret));

spi_qup_release_dma(master);
clk_disable_unprepare(controller->cclk);
clk_disable_unprepare(controller->iclk);
} else {
dev_warn(&pdev->dev, "failed to resume, skip hw disable (%pe)\n",
ERR_PTR(ret));
}

clk_disable_unprepare(controller->cclk);
clk_disable_unprepare(controller->iclk);
spi_qup_release_dma(master);

pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);

return 0;
}

static const struct of_device_id spi_qup_dt_match[] = {
Expand All @@ -1317,7 +1319,7 @@ static struct platform_driver spi_qup_driver = {
.of_match_table = spi_qup_dt_match,
},
.probe = spi_qup_probe,
.remove = spi_qup_remove,
.remove_new = spi_qup_remove,
};
module_platform_driver(spi_qup_driver);

Expand Down

0 comments on commit 43bac51

Please sign in to comment.