mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
spi: qup: Convert to platform remove callback
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.
This commit is contained in:
commit
43bac5158b
@ -1270,29 +1270,31 @@ disable_clk:
|
||||
}
|
||||
#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));
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
spi_qup_release_dma(master);
|
||||
|
||||
clk_disable_unprepare(controller->cclk);
|
||||
clk_disable_unprepare(controller->iclk);
|
||||
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id spi_qup_dt_match[] = {
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user