]> err.no Git - linux-2.6/commitdiff
[CG6]: fix memory size detection
authorKrzysztof Helt <krzysztof.h1@wp.pl>
Thu, 2 Aug 2007 04:39:32 +0000 (21:39 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 3 Aug 2007 21:08:26 +0000 (14:08 -0700)
This patch fixes memory size detection on the CG6 card.
The 1MB TGX card has dblbuf property set to 0.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/video/cg6.c

index 87c74712353873f14c15927556ecaf0eeeaa0f77..ee9046db9c7da58c4fe110a070a1ab28bb8cd1db 100644 (file)
@@ -677,6 +677,7 @@ static int __devinit cg6_probe(struct of_device *op, const struct of_device_id *
        struct fb_info *info;
        struct cg6_par *par;
        int linebytes, err;
+       int dblbuf;
 
        info = framebuffer_alloc(sizeof(struct cg6_par), &op->dev);
 
@@ -698,7 +699,9 @@ static int __devinit cg6_probe(struct of_device *op, const struct of_device_id *
        linebytes = of_getintprop_default(dp, "linebytes",
                                          info->var.xres);
        par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
-       if (of_find_property(dp, "dblbuf", NULL))
+
+       dblbuf = of_getintprop_default(dp, "dblbuf", 0);
+       if (dblbuf)
                par->fbsize *= 4;
 
        par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET,