Re: [PATCH 04/10] rtc: at91rm9200: use of_platform_populate as return value

Alexandre Belloni
2020-01-09T11:52:45Z

On 09/01/2020 11:19:45+0000, Eugen.Hristev@microchip.com wrote:
> I started to work on this, I am trying to add and probe the
> rtc_adc_trigger with platform_device_add.
>
> However, some issues arise: this means that the rtc_adc_trigger will not
> be OF-compatible, so, how can I identify the driver to probe ?
> Second, by adding a new platform device from the RTC driver, would mean
> that I would have to supply it's probe/remove functions, which I cannot
> have here. Those are in the rtc_adc_trigger iio driver.
>
> In fact, the question is, which is the mechanism you suggested, to be
> able to probe the rtc_adc_trigger, from inside the rtc driver, without
> using a child node in DT, as you requested ?
> The rtc_adc_trigger needs a MEM resource, and a parent, and it must
> reside inside the IIO subsystem.
>

As suggested earlier in the thread, you can use platform_add_device
which fits all your requirements.

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering