diff options
author | Przemyslaw Marczak | 2015-04-15 13:07:18 +0200 |
---|---|---|
committer | Simon Glass | 2015-04-22 11:03:14 -0600 |
commit | 5eaed880282480a5a0a2b555c5f98a11252ed94e (patch) | |
tree | 72f503beff647cf7389f6579add462bf1b5a0727 /include/dm/uclass.h | |
parent | c1d6f91952d0761f61b0f0f96e4c7aa32eee2788 (diff) |
dm: core: Extend struct udevice by '.uclass_platdata' field.
This commit adds 'uclass_platdata' field to 'struct udevice', which
can be automatically allocated at bind. The allocation size is defined
in 'struct uclass_driver' as 'per_device_platdata_auto_alloc_size'.
New device's flag is added: DM_FLAG_ALLOC_UCLASS_PDATA, which is used
for memory freeing at device unbind method.
As for other udevice's fields, a complementary function is added:
- dev_get_uclass_platdata()
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/uclass.h')
-rw-r--r-- | include/dm/uclass.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/dm/uclass.h b/include/dm/uclass.h index d57d8042598..b2714726183 100644 --- a/include/dm/uclass.h +++ b/include/dm/uclass.h @@ -65,6 +65,9 @@ struct udevice; * @per_device_auto_alloc_size: Each device can hold private data owned * by the uclass. If required this will be automatically allocated if this * value is non-zero. + * @per_device_platdata_auto_alloc_size: Each device can hold platform data + * owned by the uclass as 'dev->uclass_platdata'. If the value is non-zero, + * then this will be automatically allocated. * @per_child_auto_alloc_size: Each child device (of a parent in this * uclass) can hold parent data for the device/uclass. This value is only * used as a falback if this member is 0 in the driver. @@ -90,6 +93,7 @@ struct uclass_driver { int (*destroy)(struct uclass *class); int priv_auto_alloc_size; int per_device_auto_alloc_size; + int per_device_platdata_auto_alloc_size; int per_child_auto_alloc_size; int per_child_platdata_auto_alloc_size; const void *ops; |