dm: core: Allow uclasses to specify private data for a device's children
authorSimon Glass <sjg@chromium.org>
Sun, 25 Jan 2015 15:27:06 +0000 (08:27 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 30 Jan 2015 00:09:55 +0000 (17:09 -0700)
commitdac8db2ce66944828e441cccf25703b262a256cd
tree44a5625d8577254adb38364944372b55ad2549df
parent9cc36a2b89ebe5148d69d521745c1e1d26365c3a
dm: core: Allow uclasses to specify private data for a device's children

In many cases the per-child private data for a device's children is defined
by the uclass rather than the individual driver. For example, a SPI bus
needs to store information about each of its children, but all SPI drivers
store the same information. It makes sense to allow the uclass to define
this data.

If the driver provides a size value for its per-child private data, then use
it. Failng that, fall back to that provided by the uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
drivers/core/device-remove.c
drivers/core/device.c
include/dm/uclass.h
test/dm/bus.c