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

drm/simple-kms: Fix documentation for drm_simple_encoder_init()

Brings the documentation of drm_simple_encoder_init() in sync with the
function's signature. Also add a paragraph clarifying the management of
the encoder's memory.

v2:
* document memory management

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Fixes: 63170ac6f2e8 ("drm/simple-kms: Add drm_simple_encoder_{init,create}()")
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200304145312.26458-1-tzimmermann@suse.de

+12 -2
+12 -2
drivers/gpu/drm/drm_simple_kms_helper.c
··· 38 38 }; 39 39 40 40 /** 41 - * drm_simple_encoder_init - Initialize a preallocated encoder 41 + * drm_simple_encoder_init - Initialize a preallocated encoder with 42 + * basic functionality. 42 43 * @dev: drm device 43 - * @funcs: callbacks for this encoder 44 + * @encoder: the encoder to initialize 44 45 * @encoder_type: user visible type of the encoder 45 46 * 46 47 * Initialises a preallocated encoder that has no further functionality. 47 48 * Settings for possible CRTC and clones are left to their initial values. 48 49 * The encoder will be cleaned up automatically as part of the mode-setting 49 50 * cleanup. 51 + * 52 + * The caller of drm_simple_encoder_init() is responsible for freeing 53 + * the encoder's memory after the encoder has been cleaned up. At the 54 + * moment this only works reliably if the encoder data structure is 55 + * stored in the device structure. Free the encoder's memory as part of 56 + * the device release function. 57 + * 58 + * FIXME: Later improvements to DRM's resource management may allow for 59 + * an automated kfree() of the encoder's memory. 50 60 * 51 61 * Returns: 52 62 * Zero on success, error code on failure.