Hi Simon, 

On Mon, 19 Jan 2015 20:12:35 -0700
Simon Glass <s...@chromium.org> wrote:

> When using allocated platform data, allocate it when we bind the device.
> This makes it possible to fill in this information before the device is
> probed.
> 
> This fits with the platform data model (when not using device tree),
> since platform data exists at bind-time.
> 
> Signed-off-by: Simon Glass <s...@chromium.org>


Looks like you have changed your mind
to allocate platdata in device_bind() rather than device_probe().


Could you explain why you think this should be done?

I might have missed something, but your motivation is still unclear to me.

I thought one reason is consistency with platform data.

But drv->ofdata_to_platdata() is still called from device_probe(),
i.e. it is just like zero-filled memory is allocated at the binding stage.
Filling it with real device properties is delayed until the device is probed.
What is the difference from the before and what does it buy us?

Its disadvantage are clear:
 - We need more malloc memory for devices that may or may not be used.
 - The boot sequence becomes slower.

I want good reasons to compensate these disadvantages.






BTW, you missed to fix the comment in device_probe_child():

        /* Allocate private data and platdata if requested */


Best Regards
Masahiro Yamada

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to