diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-12-04 20:05:43 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-01-13 20:10:51 +0200 |
commit | b7d02c3a124d9be9cdd4982505d1ac00de4c70f2 (patch) | |
tree | 4f4415e71a5f6344fe8b8599edc25115e195ca60 /drivers/gpu/drm/i915/display/intel_dsi.h | |
parent | 43a6d19cace6e179fd129806874e96e81291485b (diff) |
drm/i915: Pass intel_encoder to enc_to_*()
Lots of enc_to_foo(&encoder->base) around. Simplify by passing
in the intel_encoder instead.
@find@
identifier F =~ "^enc_to_.*";
identifier E;
@@
F(struct drm_encoder *E)
{
...
}
@@
identifier find.F;
identifier find.E;
@@
F(
- struct drm_encoder *E
+ struct intel_encoder *encoder
)
{
<...
- E
+ &encoder->base
...>
}
@@
identifier find.F;
expression E;
@@
- F(E)
+ F(to_intel_encoder(E))
@@
expression E;
@@
- to_intel_encoder(&E->base)
+ E
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191204180549.1267-4-ville.syrjala@linux.intel.com
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_dsi.h')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dsi.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dsi.h b/drivers/gpu/drm/i915/display/intel_dsi.h index 6cef1356b4e6..19f78a4022d3 100644 --- a/drivers/gpu/drm/i915/display/intel_dsi.h +++ b/drivers/gpu/drm/i915/display/intel_dsi.h @@ -145,9 +145,9 @@ static inline struct intel_dsi_host *to_intel_dsi_host(struct mipi_dsi_host *h) #define for_each_dsi_phy(__phy, __phys_mask) \ for_each_phy_masked(__phy, __phys_mask) -static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder) +static inline struct intel_dsi *enc_to_intel_dsi(struct intel_encoder *encoder) { - return container_of(encoder, struct intel_dsi, base.base); + return container_of(&encoder->base, struct intel_dsi, base.base); } static inline bool is_vid_mode(struct intel_dsi *intel_dsi) @@ -162,7 +162,7 @@ static inline bool is_cmd_mode(struct intel_dsi *intel_dsi) static inline u16 intel_dsi_encoder_ports(struct intel_encoder *encoder) { - return enc_to_intel_dsi(&encoder->base)->ports; + return enc_to_intel_dsi(encoder)->ports; } /* icl_dsi.c */ |