Commit 9bf2db78 authored by Benjamin Gaignard's avatar Benjamin Gaignard Committed by Lee Jones

mfd: motorola-cpcap: Use devm_of_platform_populate()

Usage of  devm_of_platform_populate() simplify driver code
by allowing to delete cpcap_remove().
Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 66002163
...@@ -260,17 +260,7 @@ static int cpcap_probe(struct spi_device *spi) ...@@ -260,17 +260,7 @@ static int cpcap_probe(struct spi_device *spi)
if (ret) if (ret)
return ret; return ret;
return of_platform_populate(spi->dev.of_node, NULL, NULL, return devm_of_platform_populate(&cpcap->spi->dev);
&cpcap->spi->dev);
}
static int cpcap_remove(struct spi_device *pdev)
{
struct cpcap_ddata *cpcap = spi_get_drvdata(pdev);
of_platform_depopulate(&cpcap->spi->dev);
return 0;
} }
static struct spi_driver cpcap_driver = { static struct spi_driver cpcap_driver = {
...@@ -279,7 +269,6 @@ static struct spi_driver cpcap_driver = { ...@@ -279,7 +269,6 @@ static struct spi_driver cpcap_driver = {
.of_match_table = cpcap_of_match, .of_match_table = cpcap_of_match,
}, },
.probe = cpcap_probe, .probe = cpcap_probe,
.remove = cpcap_remove,
}; };
module_spi_driver(cpcap_driver); module_spi_driver(cpcap_driver);
......
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