Re: [PATCH 04/10] rtc: at91rm9200: use of_platform_populate as return value
From: Alexandre Belloni
Date: Wed Dec 18 2019 - 11:43:54 EST
Hi,
On 18/12/2019 16:24:00+0000, Eugen.Hristev@xxxxxxxxxxxxx wrote:
> From: Eugen Hristev <eugen.hristev@xxxxxxxxxxxxx>
>
> This allows the RTC node to have child nodes in DT.
> This allows subnodes to be probed.
>
> Signed-off-by: Eugen Hristev <eugen.hristev@xxxxxxxxxxxxx>
> ---
> drivers/rtc/rtc-at91rm9200.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
> index 3b833e0..f1b5b3d 100644
> --- a/drivers/rtc/rtc-at91rm9200.c
> +++ b/drivers/rtc/rtc-at91rm9200.c
> @@ -421,7 +421,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
> at91_rtc_write_ier(AT91_RTC_SECEV);
>
> dev_info(&pdev->dev, "AT91 Real Time Clock driver.\n");
> - return 0;
> + return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
>
You can avoid the DT binding change and DT parsing by using
platform_add_device here. I don't think there is any point describing
the trigger as a child node (a watchdog functionality wouldn't be
described for example).
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com