Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -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 = {
		.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);