Thread (23 messages) 23 messages, 5 authors, 2012-10-22

Re: [PATCH 2/2 v6] of: add generic videomode description

flat view

From: Thierry Reding <hidden>
Date: 2012-10-20 11:04:12
Also in: dri-devel, linux-devicetree, linux-media

On Thu, Oct 04, 2012 at 07:59:20PM +0200, Steffen Trumtrar wrote:
[...]
quoted hunk ↗ jump to hunk
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.
quoted hunk ↗ jump to hunk
+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().
quoted hunk ↗ jump to hunk
+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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help