f0df18e0c1df5965bb2a3ce9562f2aff7e37e944
[openwrt/staging/blogic.git] /
1 From 9dae4a5ff13701f15f051e3911a83a1e497a4bc3 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Sun, 27 Feb 2022 13:47:12 +0100
4 Subject: [PATCH] drm/mipi-dbi: Add driver_private member to struct
5 mipi_dbi_dev
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 commit 1e7e8e1 upstream.
11
12 devm_drm_dev_alloc() can't allocate structures that embed a structure
13 which then again embeds drm_device. Workaround this by adding a
14 driver_private pointer to struct mipi_dbi_dev which the driver can use for
15 its additional state.
16
17 v3:
18 - Add documentation
19
20 Acked-by: Maxime Ripard <maxime@cerno.tech>
21 Acked-by: Sam Ravnborg <sam@ravnborg.org>
22 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
23 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
24 Link: https://patchwork.freedesktop.org/patch/msgid/20220227124713.39766-5-noralf@tronnes.org
25 ---
26 include/drm/drm_mipi_dbi.h | 8 ++++++++
27 1 file changed, 8 insertions(+)
28
29 --- a/include/drm/drm_mipi_dbi.h
30 +++ b/include/drm/drm_mipi_dbi.h
31 @@ -130,6 +130,14 @@ struct mipi_dbi_dev {
32 * @dbi: MIPI DBI interface
33 */
34 struct mipi_dbi dbi;
35 +
36 + /**
37 + * @driver_private: Driver private data.
38 + * Necessary for drivers with private data since devm_drm_dev_alloc()
39 + * can't allocate structures that embed a structure which then again
40 + * embeds drm_device.
41 + */
42 + void *driver_private;
43 };
44
45 static inline struct mipi_dbi_dev *drm_to_mipi_dbi_dev(struct drm_device *drm)