From: Andrew Morton Date: Wed, 20 Feb 2013 02:13:37 +0000 (+1100) Subject: goldfish-framebuffer-driver-fix X-Git-Tag: next-20130220~1^2~659 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5728cf16b1e66a00674d6bce81b15573880a45ec;p=karo-tx-linux.git goldfish-framebuffer-driver-fix fix (silly) sparse warnings Cc: Alan Cox Cc: Arve Hjønnevåg Cc: Bruce Beare Cc: Florian Tobias Schandinat Cc: Jun Nakajima Cc: Mike A. Chan Cc: Sheng Yang Cc: Tom Keel Cc: Tomi Valkeinen Cc: Xiaohui Xin Cc: Yunhong Jiang Signed-off-by: Andrew Morton --- diff --git a/drivers/video/goldfishfb.c b/drivers/video/goldfishfb.c index f7f5c296e104..489abb32fc04 100644 --- a/drivers/video/goldfishfb.c +++ b/drivers/video/goldfishfb.c @@ -244,11 +244,12 @@ static int goldfish_fb_probe(struct platform_device *pdev) fb->fb.var.blue.length = 5; framesize = width * height * 2 * 2; - fb->fb.screen_base = dma_alloc_coherent(&pdev->dev, framesize, + fb->fb.screen_base = (char __force __iomem *)dma_alloc_coherent( + &pdev->dev, framesize, &fbpaddr, GFP_KERNEL); pr_debug("allocating frame buffer %d * %d, got %p\n", width, height, fb->fb.screen_base); - if (fb->fb.screen_base == 0) { + if (fb->fb.screen_base == NULL) { ret = -ENOMEM; goto err_alloc_screen_base_failed; } @@ -277,7 +278,8 @@ err_register_framebuffer_failed: err_request_irq_failed: err_fb_set_var_failed: dma_free_coherent(&pdev->dev, framesize, - fb->fb.screen_base, fb->fb.fix.smem_start); + (void *)fb->fb.screen_base, + fb->fb.fix.smem_start); err_alloc_screen_base_failed: err_no_irq: iounmap(fb->reg_base); @@ -296,7 +298,7 @@ static int goldfish_fb_remove(struct platform_device *pdev) unregister_framebuffer(&fb->fb); free_irq(fb->irq, fb); - dma_free_coherent(&pdev->dev, framesize, fb->fb.screen_base, + dma_free_coherent(&pdev->dev, framesize, (void *)fb->fb.screen_base, fb->fb.fix.smem_start); iounmap(fb->reg_base); return 0;