diff options
| author | Thierry Reding <treding@nvidia.com> | 2014-08-05 03:01:32 -0400 |
|---|---|---|
| committer | Thierry Reding <treding@nvidia.com> | 2014-08-06 10:44:16 -0400 |
| commit | 77df01dcd3040a7d664d85d085d4a21533824bc1 (patch) | |
| tree | 0564a409ad2195898b8e89d1aa02d9bf71f09727 /include/drm | |
| parent | dff2ed275454b5a69b785949be73e2dcbb686e3f (diff) | |
drm/dsi: Replace upcasting macro by function
Using a function instead of a macro provides proper type checking.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'include/drm')
| -rw-r--r-- | include/drm/drm_mipi_dsi.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 7b5e1a9244e1..2bb55b8b9031 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h | |||
| @@ -123,7 +123,10 @@ struct mipi_dsi_device { | |||
| 123 | unsigned long mode_flags; | 123 | unsigned long mode_flags; |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | #define to_mipi_dsi_device(d) container_of(d, struct mipi_dsi_device, dev) | 126 | static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev) |
| 127 | { | ||
| 128 | return container_of(dev, struct mipi_dsi_device, dev); | ||
| 129 | } | ||
| 127 | 130 | ||
| 128 | int mipi_dsi_attach(struct mipi_dsi_device *dsi); | 131 | int mipi_dsi_attach(struct mipi_dsi_device *dsi); |
| 129 | int mipi_dsi_detach(struct mipi_dsi_device *dsi); | 132 | int mipi_dsi_detach(struct mipi_dsi_device *dsi); |
| @@ -146,7 +149,11 @@ struct mipi_dsi_driver { | |||
| 146 | void (*shutdown)(struct mipi_dsi_device *dsi); | 149 | void (*shutdown)(struct mipi_dsi_device *dsi); |
| 147 | }; | 150 | }; |
| 148 | 151 | ||
| 149 | #define to_mipi_dsi_driver(d) container_of(d, struct mipi_dsi_driver, driver) | 152 | static inline struct mipi_dsi_driver * |
| 153 | to_mipi_dsi_driver(struct device_driver *driver) | ||
| 154 | { | ||
| 155 | return container_of(driver, struct mipi_dsi_driver, driver); | ||
| 156 | } | ||
| 150 | 157 | ||
| 151 | static inline void *mipi_dsi_get_drvdata(const struct mipi_dsi_device *dsi) | 158 | static inline void *mipi_dsi_get_drvdata(const struct mipi_dsi_device *dsi) |
| 152 | { | 159 | { |
