Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/edid: prefer forward declarations over includes in drm_edid.h

There's no need to include either linux/hdmi.h or drm/drm_mode.h. They
can be removed by using forward declarations.

While at it, group the forward declarations together, and remove the
unnecessary ones.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240104211028.1129606-1-jani.nikula@intel.com

+5 -7
+5 -7
include/drm/drm_edid.h
··· 24 24 #define __DRM_EDID_H__ 25 25 26 26 #include <linux/types.h> 27 - #include <linux/hdmi.h> 28 - #include <drm/drm_mode.h> 29 27 28 + enum hdmi_quantization_range; 29 + struct drm_connector; 30 30 struct drm_device; 31 + struct drm_display_mode; 31 32 struct drm_edid; 33 + struct hdmi_avi_infoframe; 34 + struct hdmi_vendor_infoframe; 32 35 struct i2c_adapter; 33 36 34 37 #define EDID_LENGTH 128 ··· 321 318 u8 freq; 322 319 u8 byte2; /* meaning depends on format */ 323 320 }; 324 - 325 - struct drm_encoder; 326 - struct drm_connector; 327 - struct drm_connector_state; 328 - struct drm_display_mode; 329 321 330 322 int drm_edid_to_sad(const struct edid *edid, struct cea_sad **sads); 331 323 int drm_edid_to_speaker_allocation(const struct edid *edid, u8 **sadb);