Re: [PATCH 10/15] mfd: motorola-cpcap: use devm_of_platform_populate()

From: Lee Jones
Date: Tue May 30 2017 - 06:09:33 EST


On Mon, 29 May 2017, Benjamin Gaignard wrote:

> Usage of devm_of_platform_populate() simplify driver code
> by allowing to delete cpcap_remove().
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
>
> CC: Lee Jones <lee.jones@xxxxxxxxxx>
> CC: linux-kernel@xxxxxxxxxxxxxxx
> ---
> drivers/mfd/motorola-cpcap.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> index 3cab58a..d2cc1ea 100644
> --- a/drivers/mfd/motorola-cpcap.c
> +++ b/drivers/mfd/motorola-cpcap.c
> @@ -260,17 +260,7 @@ static int cpcap_probe(struct spi_device *spi)
> if (ret)
> return ret;
>
> - return of_platform_populate(spi->dev.of_node, NULL, NULL,
> - &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;
> + return devm_of_platform_populate(&cpcap->spi->dev);
> }
>
> static struct spi_driver cpcap_driver = {
> @@ -279,7 +269,6 @@ static int cpcap_remove(struct spi_device *pdev)
> .of_match_table = cpcap_of_match,
> },
> .probe = cpcap_probe,
> - .remove = cpcap_remove,
> };
> module_spi_driver(cpcap_driver);
>

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog