[PATCH 2/2 v6] of: add generic videomode description
Thierry Reding
thierry.reding at avionic-design.de
Sat Oct 20 22:04:12 EST 2012
On Thu, Oct 04, 2012 at 07:59:20PM +0200, Steffen Trumtrar wrote:
[...]
> diff --git a/drivers/of/of_videomode.c b/drivers/of/of_videomode.c
[...]
> +#if defined(CONFIG_DRM)
This should be:
#if IS_ENABLED(CONFIG_DRM)
or the code below won't be included if DRM is built as a module. But see
my other replies as to how we can probably handle this better by moving
this into the DRM subsystem.
> +int videomode_to_display_mode(struct videomode *vm, struct drm_display_mode *dmode)
> +{
> + memset(dmode, 0, sizeof(*dmode));
It appears the usual method to obtain a drm_display_mode to allocate it
using drm_mode_create(), which will allocate it and associate it with
the struct drm_device.
Now, if you do a memset() on the structure you'll overwrite a number of
fields that have previously been initialized and are actually required
to get everything cleaned up properly later on.
So I think we should remove the call to memset().
> +int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
> + int index)
> +{
[...]
> +}
> +EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
This should be:
EXPORT_SYMBOL_GPL(of_get_fb_videomode);
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/devicetree-discuss/attachments/20121020/a2fcc215/attachment.sig>
More information about the devicetree-discuss
mailing list