drm/mipi-dbi: Add driver_private member to struct mipi_dbi_dev

devm_drm_dev_alloc() can't allocate structures that embed a structure
which then again embeds drm_device. Workaround this by adding a
driver_private pointer to struct mipi_dbi_dev which the driver can use for
its additional state.

v3:
- Add documentation

Acked-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220227124713.39766-5-noralf@tronnes.org
This commit is contained in:
Noralf Trønnes 2022-02-27 13:47:12 +01:00 committed by Maxime Ripard
parent 95ae342dc9
commit 1e7e8e18db
No known key found for this signature in database
GPG Key ID: E3EF0D6F671851C5

View File

@ -130,6 +130,14 @@ struct mipi_dbi_dev {
* @dbi: MIPI DBI interface * @dbi: MIPI DBI interface
*/ */
struct mipi_dbi dbi; struct mipi_dbi dbi;
/**
* @driver_private: Driver private data.
* Necessary for drivers with private data since devm_drm_dev_alloc()
* can't allocate structures that embed a structure which then again
* embeds drm_device.
*/
void *driver_private;
}; };
static inline struct mipi_dbi_dev *drm_to_mipi_dbi_dev(struct drm_device *drm) static inline struct mipi_dbi_dev *drm_to_mipi_dbi_dev(struct drm_device *drm)