Commit 7388c03b authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown

spi: ti-qspi: use devm_spi_register_master()

Use devm_spi_register_master() to make cleanup paths simpler,
and remove unnecessary remove().
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 716db5d6
...@@ -532,7 +532,7 @@ static int ti_qspi_probe(struct platform_device *pdev) ...@@ -532,7 +532,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
if (!of_property_read_u32(np, "spi-max-frequency", &max_freq)) if (!of_property_read_u32(np, "spi-max-frequency", &max_freq))
qspi->spi_max_frequency = max_freq; qspi->spi_max_frequency = max_freq;
ret = spi_register_master(master); ret = devm_spi_register_master(&pdev->dev, master);
if (ret) if (ret)
goto free_master; goto free_master;
...@@ -543,22 +543,12 @@ static int ti_qspi_probe(struct platform_device *pdev) ...@@ -543,22 +543,12 @@ static int ti_qspi_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int ti_qspi_remove(struct platform_device *pdev)
{
struct ti_qspi *qspi = platform_get_drvdata(pdev);
spi_unregister_master(qspi->master);
return 0;
}
static const struct dev_pm_ops ti_qspi_pm_ops = { static const struct dev_pm_ops ti_qspi_pm_ops = {
.runtime_resume = ti_qspi_runtime_resume, .runtime_resume = ti_qspi_runtime_resume,
}; };
static struct platform_driver ti_qspi_driver = { static struct platform_driver ti_qspi_driver = {
.probe = ti_qspi_probe, .probe = ti_qspi_probe,
.remove = ti_qspi_remove,
.driver = { .driver = {
.name = "ti,dra7xxx-qspi", .name = "ti,dra7xxx-qspi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment